React & Redux Sandwich Shop
This is an old post migrated from my previous blog
This is a little app I wrote last year using React and Redux, with TypeScript.
Essentially, you click on the individual ingredients you want in your sandwich, see the order build up on the side, and hit ORDER when ready. The stock updates, and the order totals build up in the manager’s dashboard at the bottom. Obviously a simplistic demo but the point is to show reusable React components and one-way state flow with Redux.
Site hosted at: http://react-redux-sandwich-shop.herokuapp.com/
Source on BitBucket: https://bitbucket.org/chocolaaaaate/react-redux-sandwich-shop/
An example component, the FoodItem component (each of the ingredient boxes) is shown below:
Food items related actions and reducers are shown below:
I love the discipline in state management that Redux forces. And the Redux tools are amazing!
At some point I’ll be following up with posts about advanced ReactJS.