Get the current value of an Observable
as a reactive Signal
.
API
Description
function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;
@paramsource
Observable<T> | Subscribable<T>
@returns
Signal<T | undefined>
function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | undefined>> & { initialValue?: undefined; requireSync?: false | undefined; }): Signal<T | undefined>;
@paramsource
Observable<T> | Subscribable<T>
@paramoptions
NoInfer<ToSignalOptions<T | undefined>> & { initialValue?: undefined; requireSync?: false | undefined; }
@returns
Signal<T | undefined>
function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | null>> & { initialValue?: null | undefined; requireSync?: false | undefined; }): Signal<T | null>;
@paramsource
Observable<T> | Subscribable<T>
@paramoptions
NoInfer<ToSignalOptions<T | null>> & { initialValue?: null | undefined; requireSync?: false | undefined; }
@returns
Signal<T | null>
function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T>> & { initialValue?: undefined; requireSync: true; }): Signal<T>;
@paramsource
Observable<T> | Subscribable<T>
@returns
Signal<T>
function toSignal<T, U>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | U>> & { initialValue: U; requireSync?: false | undefined; }): Signal<T | U>;
@paramsource
Observable<T> | Subscribable<T>
@paramoptions
NoInfer<ToSignalOptions<T | U>> & { initialValue: U; requireSync?: false | undefined; }
@returns
Signal<T | U>
Jump to details