of
Converts the arguments to an observable sequence.
Each argument becomes a next
notification.

import { of } from 'rxjs';
of(10, 20, 30)
.subscribe(
next => console.log('next:', next),
err => console.log('error:', err),
() => console.log('the end'),
);
// result:
// 'next: 10'
// 'next: 20'
// 'next: 30'
Last updated
Was this helpful?