Skip to content

Commit 1f0efc7

Browse files
klyapklyap
klyap
authored and
klyap
committed
New components with correct # of imports
1 parent 767cf4e commit 1f0efc7

9 files changed

+40
-102
lines changed

components/.DS_Store

0 Bytes
Binary file not shown.

components/DoSomething.coffee

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Basic template for your own component!
2+
13
noflo = require 'noflo'
24

35
exports.getComponent = ->
@@ -10,16 +12,38 @@ exports.getComponent = ->
1012
c.description = 'do X'
1113

1214
# Add input ports
13-
c.inPorts.add 'in',
14-
datatype: 'string'
15-
process: (event, payload) ->
16-
# What to do when port receives a packet
17-
return unless event is 'data'
18-
c.outPorts.out.send payload
15+
c.inPorts.add 'func', (event, payload) ->
16+
return unless event is 'data'
17+
c.outPorts.out.send payload
18+
19+
c.inPorts.add 'type', (event, payload) ->
20+
return unless event is 'data'
21+
# Do something with the packet, then
22+
c.outPorts.out.send payload
23+
24+
c.inPorts.add 'state', (event, payload) ->
25+
return unless event is 'data'
26+
# Do something with the packet, then
27+
c.outPorts.out.send payload
28+
29+
c.inPorts.add ‘parameter1’, (event, payload) ->
30+
return unless event is 'data'
31+
# Do something with the packet, then
32+
c.outPorts.out.send payload
33+
34+
c.inPorts.add ‘parameter2’, (event, payload) ->
35+
return unless event is 'data'
36+
# Do something with the packet, then
37+
c.outPorts.out.send payload
38+
39+
c.inPorts.add 'input’, (event, payload) ->
40+
return unless event is 'data'
41+
# Do something with the packet, then
42+
c.outPorts.out.send payload
43+
1944
2045
# Add output ports
21-
c.outPorts.add 'out',
22-
datatype: 'string'
46+
c.outPorts.add 'output’
2347

2448
# Finally return the component instance
2549
c

components/averages_list.coffee

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/multiply.coffee

Lines changed: 0 additions & 16 deletions
This file was deleted.

components/print_is_multiple_lists.coffee

Lines changed: 0 additions & 24 deletions
This file was deleted.

components/print_next_and_mean.coffee

Lines changed: 0 additions & 24 deletions
This file was deleted.

components/print_value_stream.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ noflo = require 'noflo'
22

33
exports.getComponent = ->
44
c = new noflo.Component
5-
c.inPorts.add 'in', (event, payload) ->
5+
c.inPorts.add ‘func’, (event, payload) ->
66
return unless event is 'func'
77
# Do something with the packet, then
88
c.outPorts.out.send payload
9-
c.inPorts.add 'in', (event, payload) ->
9+
c.inPorts.add ’type’, (event, payload) ->
1010
return unless event is 'type'
1111
# Do something with the packet, then
1212
c.outPorts.out.send payload
13-
c.inPorts.add 'in', (event, payload) ->
13+
c.inPorts.add ‘state’, (event, payload) ->
1414
return unless event is 'state'
1515
# Do something with the packet, then
1616
c.outPorts.out.send payload

components/split_even_odd.coffee

Lines changed: 0 additions & 11 deletions
This file was deleted.

components/split_even_odd_stream.coffee

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ noflo = require 'noflo'
22

33
exports.getComponent = ->
44
c = new noflo.Component
5-
c.inPorts.add 'in', (event, payload) ->
6-
return unless event is 'data'
7-
# Do something with the packet, then
8-
c.outPorts.out.send payload
5+
96
c.inPorts.add 'func', (event, payload) ->
107
return unless event is 'data'
118
# Do something with the packet, then
@@ -18,6 +15,10 @@ exports.getComponent = ->
1815
return unless event is 'data'
1916
# Do something with the packet, then
2017
c.outPorts.out.send payload
18+
c.inPorts.add 'in', (event, payload) ->
19+
return unless event is 'data'
20+
# Do something with the packet, then
21+
c.outPorts.out.send payload
2122
c.outPorts.add 'odd'
2223
c.outPorts.add 'even'
2324
c

0 commit comments

Comments
 (0)