-
Notifications
You must be signed in to change notification settings - Fork 52
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
where to init redux store #81
Comments
I think you are doing it partially correct. But, you need to write your reducers inside the module. Then pass that rootReducer to the initContext() and use that to create the store. |
in a somewhat related question, where should I put my reducers inside a module? |
I put them into configs for now https://github.com/ShockiTV/mantra-sample-blog-app/tree/redux |
@lsunsi it probably depends on the complexity of your project, but I think it's a good idea to separate your actions and reducers into separate directories. |
@ShockiTV 's example is quite inspiring, but it seems incomplete. The reducers and stores are not bind to React components yet, and there's no usage of https://github.com/haizi-zh/mantra-sample-blog-app In summary:
Wish this can help! Update: I've also submitted a pull request regarding this: |
Hello,
I managed to use redux to keep state of my autogenerated navigation.
Navigation is in core module.
Store is initialized in
client/config/context.js
.Test repo https://github.com/ShockiTV/mantra-test .
Question is where is best place to init store ?
Prepare it in separate file in
client/config
and import it inclient/config/context.js
from where it get exported to that kinda global app context?So in theory same way how I am doing, just put it in separate file ?
The text was updated successfully, but these errors were encountered: