• Overview
@angular/core/rxjs-interop

toSignal

function

Get the current value of an Observable as a reactive Signal.

  
    
  
  
function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;
@paramsourceObservable<T> | Subscribable<T>
@returnsSignal<T | undefined>
function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | undefined>> & { initialValue?: undefined; requireSync?: false | undefined; }): Signal<T | undefined>;
@paramsourceObservable<T> | Subscribable<T>
@paramoptionsNoInfer<ToSignalOptions<T | undefined>> & { initialValue?: undefined; requireSync?: false | undefined; }
@returnsSignal<T | undefined>
function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | null>> & { initialValue?: null | undefined; requireSync?: false | undefined; }): Signal<T | null>;
@paramsourceObservable<T> | Subscribable<T>
@paramoptionsNoInfer<ToSignalOptions<T | null>> & { initialValue?: null | undefined; requireSync?: false | undefined; }
@returnsSignal<T | null>
function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T>> & { initialValue?: undefined; requireSync: true; }): Signal<T>;
@paramsourceObservable<T> | Subscribable<T>
@paramoptionsNoInfer<ToSignalOptions<T>> & { initialValue?: undefined; requireSync: true; }
@returnsSignal<T>
function toSignal<T, U>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | U>> & { initialValue: U; requireSync?: false | undefined; }): Signal<T | U>;
@paramsourceObservable<T> | Subscribable<T>
@paramoptionsNoInfer<ToSignalOptions<T | U>> & { initialValue: U; requireSync?: false | undefined; }
@returnsSignal<T | U>
Jump to details