leftiness / react-demo

Other
0 stars 0 forks source link

Sidebar should be more persistent maybe? #41

Open leftiness opened 8 years ago

leftiness commented 8 years ago
leftiness commented 8 years ago

How would this work exactly?

If the application component dispatches onhashchange() to say that we're at site.com?sidebar=1, then that goes to the navigation reducer, which sets state.navigation.location. Then the app renders again. How do I get it to also set state.sidebar?

Can the navigation reducer alter state.sidebar? I don't think so. There needs to be a sidebar reducer. I can't dispatch two actions onhashchange (pretty sure that's actually something they say is wrong).

Maybe I can have multiple reducers which are listening for the same action and doing different things as a result? Do reducers work like express middleware like that? If so, then I could just listen for the NAVIGATION action and then set state.sidebar to show the sidebar.