useSubscribe(source)

A React hook that creates a subscription to the provided Observable once the component mounts and it unsubscribes when the component unmounts.

function useSubscribe<T>(source$: Observable<T>): void;

Arguments

  • source$: Source Observable that the hook will subscribe to.
Important

This hook doesn't trigger any updates.

See also