streamich/rx-use

React hook that returns unmount notifier observable

Aperta

#14 aperta il 18 mag 2020

 (0 commenti) (0 reazioni) (0 assegnatari)TypeScript (0 fork)github user discovery
good first issuehelp wanted

Metriche repository

Star
 (21 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Create React hook which returns and indicator observable which signals when component was unmounted.

const MyComponent = () => {
  const unmounted$ = useUnmounted();

  useEffect(() => {
    something$.pipe(
      takeUntil(unmounted$)
    );
  }, []);
};

Guida contributor