streamich/rx-use

React hook that returns unmount notifier observable

Open

#14 opened on May 18, 2020

 (0 comments) (0 reactions) (0 assignees)TypeScript (0 forks)github user discovery
good first issuehelp wanted

Repository metrics

Stars
 (21 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

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

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

Contributor guide