Efficient-angular
GitHubToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

From

Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object.

Syntax

from<T>(input: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T>
ParametersDescription
inputType: ObservableInput.
scheduler OptionalDefault is undefined. Type: SchedulerLike.

Returns

Observable:

Example

Converts an array to an Observable

import { from } from 'rxjs';

const array = [10, 20, 30];
const result = from(array);

result.subscribe(x => console.log(x));

// Logs:
// 10
// 20
// 30