redux-router

Is it an efficient practice to add new epics lazily inside react-router onEnter hooks?

允我心安 提交于 2019-12-03 21:49:33
问题 When using redux-observable with react-router, would it make sense to asynchronously add new epics as per the instructions in the documentation here inside onEnter hooks of react-router during route changes? ./epics/index.js import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { combineEpics } from 'redux-observable'; import { epic1 } from './epic1' import { epic2 } from './epic2' export const epic$ = new BehaviorSubject(combineEpics(epic1, epic2)); export const rootEpic = (action$,

Is it an efficient practice to add new epics lazily inside react-router onEnter hooks?

老子叫甜甜 提交于 2019-11-30 23:41:36
When using redux-observable with react-router, would it make sense to asynchronously add new epics as per the instructions in the documentation here inside onEnter hooks of react-router during route changes? ./epics/index.js import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { combineEpics } from 'redux-observable'; import { epic1 } from './epic1' import { epic2 } from './epic2' export const epic$ = new BehaviorSubject(combineEpics(epic1, epic2)); export const rootEpic = (action$, store) => epic$.mergeMap(epic => epic(action$, store) ); export { rootEpic }; ...routes/SomePath/index