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

Add exhaustmap example #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/data/transformation-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ export const transformationExamples = {
}
},

exhaustMap: {
label: 'obs1$.exhaustMap(() => obs2$, (x, y) => "" + x + y)',
inputs: [
[{t:0, c:'A'}, {t:42, c:'B'}, {t:55, c:'C'}],
[{t:0, c:1}, {t:10, c:2}, {t:20, c:3}, 25]
],
apply: function(inputs, scheduler) {
return inputs[0].pluck('content')
.exhaustMap(() => inputs[1].pluck('content'), (x, y) => '' + x + y);
}
},

map: {
label: 'map(x => 10 * x)',
inputs: [
Expand Down