import { fromObservable, type Observable } from "effector";
Methods
fromObservable()
Creates an event containing all items from an Observable.
Formulae
fromObservable<T>(source: Observable<T>): Event<T>
Arguments
observable
(Observable)
Returns
Event: New event
Examples
Basic use case
import { interval } from "rxjs";
import { fromObservable } from "effector";
//emit value in sequence every 1 second
const source = interval(1000);
const event = fromObservable(source);
//output: 0,1,2,3,4,5....
event.watch(console.log);