awebfactory / react-pathways

ReactPathways. Now becoming an educational app to help you find your own way to ReactJS step by step. Come watch us build it! It makes for a great up-to-date non-trivial React, React Router and Redux example app
http://reactpathways.org/
GNU General Public License v3.0
8 stars 3 forks source link

MVP01 Defining and documenting state shape, synchronous action creators, reducers, asynchronous action creators and middleware with placeholder data #16

Open victorkane opened 8 years ago

victorkane commented 8 years ago

The Redux store holds the state and the reducers. So we can see the reducers in ./app/reducers, but where can I see the state as a single tree?

Well, we use state logger and we can use Chrome Developer Tools $r in the console and to a $r.store.getState() at any time to see the state in some way, shape or form. But we need to define it after we define the actions and before we design and implement the reducers, the code that the store uses to modify the state when it receives dispatched actions.

So it's a question of analysis and design, and it is the invisible basis for the logic in the reducers' code.

If we put it into a doc directory, it will be silly because it will quickly become out of date and no-one will update it, once the system is functional and we "know" what the state is. We just need an initial version on the basis of which to design and implement the first version of the reducers.

So let's just put it here in the issue queue! No, better yet, even though it's for documentation purposes, let's keep it in ./app/reducers.

victorkane commented 8 years ago

First cut at state shape for path steps. It's just a JavaScript object. We are using the second approach in the redux docs, that designed for user editable applications and nested entities.

victorkane commented 8 years ago

How is this playing out with react-router? Should we use redux-router?

victorkane commented 8 years ago

We done thunkit!