Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
Add withLatestFrom example
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Medeiros committed Jan 30, 2015
1 parent 8321093 commit 656b757
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ DONE Bug: slowly dragging should change marble time

DONE Cycle.js rewrite
DONE Fix throttleWithSelector
TODO Add withLatestFrom example
DONE Add withLatestFrom example
TODO Review all RxJS operators to remove deprecated
>>> v1.2.0

TODO Build scripts to replace gulp (?)
Expand Down
10 changes: 10 additions & 0 deletions dist/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24279,6 +24279,16 @@ module.exports = {
}
},

withLatestFrom: {
label: "withLatestFrom((x, y) => \"\" + x + y)",
inputs: [[{ t: 0, d: 1 }, { t: 20, d: 2 }, { t: 65, d: 3 }, { t: 75, d: 4 }, { t: 92, d: 5 }], [{ t: 10, d: "A" }, { t: 25, d: "B" }, { t: 50, d: "C" }, { t: 57, d: "D" }]],
apply: function (inputs) {
return inputs[0].withLatestFrom(inputs[1], function (x, y) {
return "" + x.get("content") + y.get("content");
});
}
},

zip: {
label: "zip",
inputs: [[{ t: 0, d: 1 }, { t: 20, d: 2 }, { t: 65, d: 3 }, { t: 75, d: 4 }, { t: 92, d: 5 }], [{ t: 10, d: "A" }, { t: 25, d: "B" }, { t: 50, d: "C" }, { t: 57, d: "D" }]],
Expand Down
13 changes: 13 additions & 0 deletions src/data/combine-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ module.exports = {
}
},

"withLatestFrom": {
"label": "withLatestFrom((x, y) => \"\" + x + y)",
"inputs": [
[{t:0, d:1}, {t:20, d:2}, {t:65, d:3}, {t:75, d:4}, {t:92, d:5}],
[{t:10, d:"A"}, {t:25, d:"B"}, {t:50, d:"C"}, {t:57, d:"D"}]
],
"apply": function(inputs) {
return inputs[0].withLatestFrom(inputs[1],
(x, y) => ("" + x.get('content') + y.get('content'))
);
}
},

"zip": {
"label": "zip",
"inputs": [
Expand Down

0 comments on commit 656b757

Please sign in to comment.