nrgy
Version:
The library for reactive programming using efficient computing and MVC/MVVM patterns
25 lines (22 loc) • 1.25 kB
text/typescript
export { A as AtomObserveOptions, S as SignalObserveOptions, o as observe } from './observe-C5r3qKaO.cjs';
import { Observable, Subscribable } from 'rxjs';
import { D as DestroyableAtom } from './types-CxOJPpKX.cjs';
/**
* Get the current value of an `Observable` as a reactive `Atom`.
*
* `fromObservable` returns a `Atom` which provides synchronous reactive access to values produced
* by the given `Observable`, by subscribing to that `Observable`. The returned `Atom` will always
* have the most recent value emitted by the subscription, and will throw an error if the
* `Observable` errors.
*/
declare function fromObservable<T>(source: Observable<T> | Subscribable<T>): DestroyableAtom<T | undefined>;
/**
* Get the current value of an `Observable` as a reactive `Atom`.
*
* `fromObservable` returns a `Atom` which provides synchronous reactive access to values produced
* by the given `Observable`, by subscribing to that `Observable`. The returned `Atom` will always
* have the most recent value emitted by the subscription, and will throw an error if the
* `Observable` errors.
*/
declare function fromObservable<T>(source: Observable<T> | Subscribable<T>, initialValue: T): DestroyableAtom<T>;
export { fromObservable };