Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const items$ = Rx.Observable.of([10, 20, 30], [20,30,40])
- .reduce((acc, curr) => acc.concat(curr));
- let itemsArray = [];
- items.subscribe(arr => itemsArray = arr);
- console.log(itemsArray); // [10, 20, 30, 20, 30, 40]
- const itemsArray = Rx.Observable.of([10, 20, 30], [20,30,40])
- .reduce((acc, curr) => acc.concat(curr))
- .collect( /* return a number[] - not an Observable<number[]> */);
- console.log(itemsArray); // [10, 20, 30, 20, 30, 40]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement