Closed jakereps closed 8 years ago
Ah good point, I did not know dispatch
had a return value, so thanks for bringing it up.
If you could submit a PR to fix this that would be a huge help, since I'm pretty busy for the next week or so. If you don't end up submitting a PR, I'll get to fixing this when I can.
I can definitely look into it.
Thanks for this awesome package, by the way! It was a huge help with removing ipc "hacks" that threw objects between windows.
Published in v0.3.11
:+1:, thanks for contributing!
Awesome! You're welcome! Thank you again, for this awesome package!
The default return value for a Redux
dispatch()
is the action that was launched by the call. This package is breaking that default behavior, anddispatch()
is only returningundefined
.To show a real-world application of this feature, here is a chunk of code from a project that is using the returned actions:
Where the
json.plugins.map(dispatch())
was producing a list of the actions that were dispatched and would pass them along to the next step in the chain. After addingredux-electron-store
, all that is returned is a list ofundefined
's.I tried hooking into the
postDispatchCallback()
to see if I could pump the action through using one of the available API methods, but it doesn't seem like that will work since telling that callback to return the action will just return it to thedoDispatch
method body, and not out of thedispatch()
call itself.