-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathon.js
47 lines (47 loc) · 992 Bytes
/
on.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module.exports = {
name: "on",
ns: "socket.io-client",
description: "Acts upon the specified `on` event",
phrases: {
active: "Reacting on {input.event} event"
},
ports: {
input: {
socket: {
type: "function",
title: "io socket server handle",
description: "Expects a io socket server node.",
readonly: true,
required: true
},
event: {
type: "string",
"enum": ["connect"],
title: "On Event",
description: "Reacts on the `on` event specified.",
required: true
}
},
output: {
out: {
type: "any",
title: "Output"
}
}
},
fn: function on(input, $, output, state, done, cb, on) {
var r = function() {
$.io.sockets.on($.event, function onCallback(out) {
cb({
out: out
});
});
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}