Function toSignal

Creates an ObserverSignal which observes the given observable. Note that by default the signal includes undefined as valid value. If you don't want that then either specify an initialValue in the signal options or use the requireSync option to define that the observable does emit a value synchronously on subscription.

To prevent memory leaks you must either manually destroy the signal with the ObserverSignal.destroy method or use a SignalScope which automatically destroys observer signals created within the scope when the scope is destroyed.

The observable to subscribe to.

Optional signal options.

The created observer signal.