Closed demian85 closed 7 years ago
Hi, thanks for submitting this issue, I've updated the docs to address a couple of your points so that this hopefully doesn't happen to others.
dispatchProxy: a => store.dispatch(a)
is necessary because electronEnhancer
needs to be able to dispatch
actions for you whenever actions are dispatched in other processes. If you omit this field, what happens is that if you had libraries that react to dispatches like redux-logger
, they may not get notified of actions electronEnhancer
dispatches. The issue that prompted this addition was https://github.com/samiskin/redux-electron-store/issues/31filter
option is a no-op in the main process. You can also use the same module but have renderer
specific logic by checking process.type === 'renderer'
.__REDUX_ELECTRON_STORE__
which gets set to the store
in the main process. Its 100% an implementation detail and was necessary for renderer
s to obtain their initial state, so I've now removed it from the README
to avoid further confusions.Ok great, but unfortunately, it seems that I'm having issues regarding references to objects created in the renderer process and accessing them from the main process. Not sure how to solve this issue, for example, I have a VideoRecorder instance inside an async action module, but that action is also being required by the main process, so dispatching an action that uses that reference fails because it's undefined... Need to deal with magic here :/ Thanks for the clarification though.
I have a few questions:
dispatchProxy: a => store.dispatch(a)
? It's not documented in the API section.remote.getGlobal
is used. Not clear if I need to create a global reference to store or it's being done for me underneath...Thanks.