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.
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.