-
Notifications
You must be signed in to change notification settings - Fork 46
Cheatsheet:Network
Ulric Wilfred edited this page Jan 31, 2015
·
1 revision
var model = Rpd.Model.start().attachTo(document.body)
.renderWith('html', { /* layout: 'pd' */ });
var genA = new Rpd.Node('core/custom', 'Generate A');
var outA = genA.addOutlet('core/number', 'A');
var genA = new Rpd.Node('core/custom', 'Generate B');
var outB = genA.addOutlet('core/number', 'B', '', 1);
var sumOfThree = new Rpd.Node('core/sum-of-three', 'Sum1');
var inA = sumOfThree.inlets['a'];
var inB = sumOfThree.inlets['b'];
outA.connect(inA);
outB.connect(inB);
var sumOfThreeBody = new Rpd.Node('core/sum-of-three-with-body', 'Sum2');
var inABody = sumOfThreeBody.inlets['a'];
var inBBody = sumOfThreeBody.inlets['b'];
outA.connect(inABody);
outB.connect(inBBody);
outA.stream(Kefir.repeatedly(10, [1, 2, 3]));
outB.stream(Kefir.repeatedly(20, [4, 5, 6]));
// outC.send(5);