Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firing redux actions from the application menu #118

Closed
slightlytyler opened this issue Dec 29, 2015 · 8 comments
Closed

Firing redux actions from the application menu #118

slightlytyler opened this issue Dec 29, 2015 · 8 comments

Comments

@slightlytyler
Copy link
Contributor

What's the preferred way of hooking the application menu into redux? I've implemented undo / redo but am having trouble firing the actions from the menu click. It would be nice to have an example of this included in the repo

@jhen0409
Copy link
Member

jhen0409 commented Jan 4, 2016

We can use ipc to do it.
Also, if we done #108, it may become easier. :)

@slightlytyler
Copy link
Contributor Author

@jhen0409 I am interested in #108 however I would like to see the starter include an example of how to accomplish it without redux-electron-store.

In my app I created a function bindStoreToMenu that is called when the store is configured. Also created a middleware undoRedoMenuState to properly set the enabled boolean for the menu items.

https://github.com/slightlytyler/mocksy/blob/master/app/store/bindStoreToMenu.js
https://github.com/slightlytyler/mocksy/blob/master/app/store/undoRedoMenuState.js

Any feedback on my logic is welcome, I'll gladly contribute what I can if this is something the project would like to include

@amilajack
Copy link
Member

@burkhardr is it possible to do this with electron-redux?

@ghost
Copy link

ghost commented May 3, 2017

@amilajack Yeah, couldn't see why not!

@amilajack
Copy link
Member

Great! Closing this in favor of #968.

@wandonye
Copy link

Can anyone explain a little bit how this is done with electron-redux? Do I need to create a container for MenuBuilder just like other components?

@wandonye
Copy link

ok, looks like #1615 is the answer for me

@wandonye
Copy link

wandonye commented Aug 3, 2018

never mind, this stackoverflow solution is the simplest. I tried electron-redux, but in my case it creates some weird sync problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants