RxJS - Creation Operator from



This operator will create an observable from an array, an array-like object, a promise, an iterable object, or an observable-like object.

Syntax

from(input: ObservableInput): Observable

Parameters

input − The input given to this operator is an Observable.

Return value − It returns an observable.

Example

import { from } from 'rxjs';

let arr = [2, 4, 6, 8 , 10];
let test = from(arr);
test.subscribe(x => console.log(x));

Output

From Operator
Advertisements