samiskin / redux-electron-store

⎋ A redux store enhancer that allows automatic synchronization between electron processes
MIT License
375 stars 32 forks source link

What does the `synchronous` option do? #12

Closed davej closed 8 years ago

davej commented 8 years ago

I'm struggling to understand what the synchronous option is for. It's set to true by default but I had to set it to false because otherwise it was duplicating all my actions.

samiskin commented 8 years ago

At my company we had all the actions forwarded to the main process, and then the update would be sent to all of the processes, including the origin of the action. We then needed a way for a process to specify that it would run the actions on its own and not wait for updates because that process needed to perform the actions synchronously (it was interfacing with a webview which expected certain things).

If its duplicating actions then that sounds like a bug. I believe the way it avoids duplicating actions is it checks the source parameter.

davej commented 8 years ago

Ah, I see the problem now, it's related to my PR. Will update in a little bit.

davej commented 8 years ago

So it was an issue related to my PR, I was comparing against the stringified version of the action (see commit ref above).