Function useWhileMounted

  • Ties a subscription to the lifetime of the component that calls useWhileMounted. Given a function which is either a useEffect-style callback, or returns an Observable of subscription, runs/subscribes it at component mount time, and runs the cleanup callback/unsubscribes at unmount time.

    Parameters

    • sourceFactory: EffectCallback | (() => Subscription) | (() => Observable<any>)

    Returns void

Generated using TypeDoc