or
This project was bootstrapped with Create React App and makes minimal use of regular Redux. Rather, it focuses on how the Saga pattern enhances Redux to make the app flow easier and simpler to control.
Source: Redux-Saga tutorial for beginners and dog lovers
Just download, npm install
and npm start
. The app will open on your browser and it's front-end only.
Saga is a pattern that has been around for quite some time. First proposed in 1987 by Hector Garcia-Molina and Kenneth Salem, it dealt at first exclusively with database transactions; more precisely, how to deal with long-lived transactions that you could not start and end in a very short time and thus guarantee them to be atomic.
The solution was to break large transactions down to smaller ones, and accept that they would come in a sequence. As soon as one of them failed, rather than revert the whole transaction at once (which at this point is understood is not possible anymore), each successfully completed transaction can be compensated, or undone, by a semantically equivalent one, that has the opposite effect.
Which brings us to...
Redux-Saga aims to manage the effect actions have when performed on the application. Redux by itself does a great job at managing state, but it can be cumbersome to fire several things that should happen from one action, either in sequence or at the same time, or following a certain interval. Enter the Saga pattern, which captures a regular Redux instruction and can do several things with it -- be it fetch some data, wait for the next call, or run some logic of its own.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner.
See the section about running tests for more information. Code coverage is always collected into src/coverage
folder.
- MSW is not capturing network traffic, thus impairing some of the tests.
Launches the test runner in the interactive watch mode.
Code coverage is always collected into src/coverage
folder.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify