Actions and Reducers
Bookstore App Learning Objectives
- Add Redux Toolkit using
npm install react-redux @reduxjs/toolkit
- Write book actions and reducer (in /src/redux/books/books.js) using the ducks pattern.
- Write categories actions and reducer (in /src/redux/categories/categories.js) using the ducks pattern.
- Configure the Redux Store (/src/redux/configureStore.js)
- Understand the concept of state management.
- Use store, actions and reducers in React.
- Connect React and Redux.
- Connect an existing API via Redux and use the data to display something in a UI.
Description
Configure Redux Store and write actions and reducer for adding and removing books.
General requirements
- No linter errors.
- Correct Gitflow.
- Professional work documentation.
- JavaScript best practices
Built With
- React and Redux
Setup instructions for Different OS's
Milestone Reached
- Set up
React
App - Creatd a directory called components.
- Inside components, created Categories, Boolist, Book, Form, Header and Home components.
- Used React Router.
- Used css to apply basic styles.
- Used useSelector to consume the state.
- Imported Redux Provider and store in the main component of React app.
- Imported Redux useDispatch.
- Used
fetch
withcreateAsyncThunk
for making API calls. - Fetched book list from Bookstore API on Books page load
- Refactored
add book
andremove book
features to persist changes in the server.
npm start
Runs the app in the development mode.\ Or Open http://localhost:3000 to view it in your browser.
Live Demo
Authors
👤 KASAIJA KENNETH
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Show your support
Give a ⭐️ if you like this project!