-
Notifications
You must be signed in to change notification settings - Fork 46
Ref:Inlet
Ulric Wilfred edited this page Jan 30, 2015
·
2 revisions
Represents the Inlet.
-
inlet/update
→(Any)
— fired when inlet receives a value;{inlet, value}
-
inlet.receive(Any)
— receive the value; -
inlet.stream(KefirStream)
— append given stream to the value stream; -
inlet.toDefault()
— manually send default value to this inlet;
Create node and add an inlet:
var node = new Rpd.Node('core/custom');
var inlet = node.addInlet('core/number', 'num');
Receive a value:
inlet.receive(10);
Receive a stream of values:
inlet.send(Kefir.repeatedly(500, [10, 20, 30]));
Subscribe to inlet/update
event:
var model = Rpd.Model.start()
.renderWith('html')
.attachTo(document.body);
var node = new Rpd.Node('core/custom', 'Custom');
node.event['node/process'].onValue(function(vals) {
var inlets = vals[0],
outlets = vals[1],
prev_inlets = vals[2];
console.log(inlets, outlets, prev_inlets);
});