RxJS - Creation Operator of



This operator will take in the arguments passed and convert them to observable.

Syntax

of(input: array[]):Observable

Parameters

input − The input given is an array form.

Return value

It returns an observable with values from the source observable.

Example

import { of } from 'rxjs';

let ints = of(2,4,6,8,10,12);
ints.subscribe(x => console.log(x));

Output

of Operator
Advertisements