How to use the @reactorx/core.useEpic function in @reactorx/core

To help you get started, we’ve selected a few @reactorx/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github querycap / reactorx / @reactorx / router / src / ReactorxRouter.tsx View on Github external
const state = store$.getState();
    if (state[locationStorageKey]) {
      history.replace(state[locationStorageKey]);
    }
  }, []);

  useEffect(() => {
    const unlisten = history.listen((location) => {
      routerChanged.with(location).invoke(store$);
    });
    return () => {
      unlisten();
    };
  }, []);

  useEpic(createRouterEpic(history));

  return null;
}