- RxJS Tutorial
- RxJS - Home
- RxJS - Overview
- RxJS - Environment Setup
- RxJS - Latest Updates
- RxJS - Observables
- RxJS - Operators
- RxJS - Working with Subscription
- RxJS - Working with Subjects
- RxJS - Working with Scheduler
- RxJS - Working with RxJS & Angular
- RxJS - Working with RxJS & ReactJS
- RxJS Useful Resources
- RxJS - Quick Guide
- RxJS - Useful Resources
- RxJS - Discussion
RxJS - Join Operator forkJoin
This operator will take in an array or dict object as an input and will wait for the observable to complete and return the last values emitted from the given observable.
Syntax
forkJoin(value: array or dict object): Observable
Parameters
value − The value is the input which can be an array or dict object.
Return value
An observable is returned with last values emitted from the given observable.
Example
import { of, forkJoin } from 'rxjs'; import { concat } from 'rxjs/operators'; let list1 = of(2, 3, 4, 5, 6); let list2 = of(4, 9, 16, 25, 36) let final_val = forkJoin([list1, list2]); final_val.subscribe(x => console.log(x));
Output
[6,36]
Advertisements