rxjs/operators#merge TypeScript Examples
The following examples show how to use
rxjs/operators#merge.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: app.component.ts From Angular-Cookbook with MIT License | 6 votes |
startStream() {
const streamSource = interval(1500);
const cartoonStreamSource = interval(1000).pipe(
map((output) => output % this.cartoonsStreamData.length),
map((index) => this.cartoonsStreamData[index])
);
this.subscription = streamSource
.pipe(
map((output) => output % this.inputStreamData.length),
map((index) => this.inputStreamData[index]),
merge(cartoonStreamSource)
)
.subscribe((element) => {
this.outputStreamData.push(element);
});
}
Example #2
Source File: app.component.ts From Angular-Cookbook with MIT License | 6 votes |
startStream() {
const streamSource = interval(1500);
const cartoonStreamSource = interval(1000)
.pipe(
map(output => output % this.cartoonsStreamData.length),
map(index => this.cartoonsStreamData[index]),
)
this.subscription = streamSource
.pipe(
map(output => output % this.inputStreamData.length),
map(index => this.inputStreamData[index]),
merge(cartoonStreamSource)
)
.subscribe(element => {
this.outputStreamData.push(element);
});
}