git clone https://github.com/imranhsayed/redux-example
npm install
npm run dev
npm run build
- 🏬 1-basic-redux-store Basic Redux store without using React. Find all code in src/store.js
- 🏬 combine-multiple-reducers Example for multiple reducers
- :squirrel: 3-fetch-posts Redux Example to fetch Posts from https://jsonplaceholder.typicode.com/
- 🎒 asynchronous-actions-with-redux Handling asynchronous actions with redux
- 🎒redux-with-react Using Redux store for data in React Components
npm i redux react-redux redux-thunk prop-types
-Create a directory called actions inside src -Create a file called types.js -Create an action file called postActions and add an action creator function to create an action -Each action creator is a function
-Create a directory called reducers inside src -Create a file called postReducers.js inside src/reducers -Create a file called index.js inside src/reducers and combine your reducers
-A Store holds your application state. -create a file called store.js and create a store using createStore()
-Wrap your App.js inside the Provider and pass store to it.
-Connect React with redux -Define proptypes -Map state to props -Call Actions ( this.props.fetchPosts() )