Closed publicvirtualvoid closed 3 years ago
It might be related to middleware & enhancer conflict -> can you try doing with with composeWithStateSync
(here is example)
I've ended up with this after some fiddling. It's all running, everything working well! Thanks very much.
export const mainStore = (() => {
const epicMiddleware = createEpicMiddleware();
const store = createStore(
rootReducer,
composeWithStateSync({})(applyMiddleware(epicMiddleware))
);
const testEpic = (action$: any) =>
action$.pipe(
tap((v) => {
console.log('from main');
console.log(v);
}),
ignoreElements()
);
const rootEpic = combineEpics(testEpic);
epicMiddleware.run(rootEpic);
return store;
})();
Edit: this was actually working fine!
Closing since its resolved now
Using
electron-redux@2.0.0-alpha.8
andredux-observable@1.2.0
in a fairly basic configuration. I am not seeing epics defined in the main context triggered by actions dispatched by the renderer context, and vice-versa. Is this expected behaviour? I was really hoping to handle context-dependent side-effects this way. It's entirely possible I'm doing something silly, would someone be able to lend a hand?Here's the main store:
And the renderer (mostly identical):