MadeInHaus / react-starter

A client-side SPA starter bundled with React, Redux, CSS Modules, React Router 4, and Webpack 4
MIT License
9 stars 2 forks source link

Reducer should use action.type and be called with action.payload as its arg #12

Closed rynocouse closed 6 years ago

rynocouse commented 7 years ago

https://github.com/MadeInHaus/react-redux-webpack-starter/blob/a6088771b2d0d1c694372e7e1c95b391269b7143/src/reducers/app.js#L11

chrisjcodes commented 7 years ago

This is fixed in the fix-reducer-example branch https://github.com/MadeInHaus/react-redux-webpack-starter/tree/fix-reducer-example. Would also like to add an example of a state setter/action before making a PR. Suggestions on what that should be?

@stevescavo @rynocouse

rynocouse commented 7 years ago

I'd like to see samples of a few typical things like: async fetch, some ui state and maybe a input of sorts? this all might be too much sample code

chrisjcodes commented 7 years ago

I think async for sure and something simple like UI state. We should do it in one component so its easy to tear out. Also a selector. I dont think we need a user input, with the other 2 examples you should be able to deduce how to send a value via an action creator to your reducer