React-redux-saga-demo | sample react project implements the login function
kandi X-RAY | React-redux-saga-demo Summary
kandi X-RAY | React-redux-saga-demo Summary
A sample react project implements the login function by react-router,redux ,redux-saga,ant-design.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of React-redux-saga-demo
React-redux-saga-demo Key Features
React-redux-saga-demo Examples and Code Snippets
Community Discussions
Trending Discussions on React-redux-saga-demo
QUESTION
I'm very new to redux-saga and am trying to get a simple demo working that makes an API call and sends the response data to a reducer so it can be saved to the store. It is my understanding that the redux-saga flow should work as follows.
- A component calls an action creator
- The action creator then emits an action using a specific type
- The watcher sagas all listen for any actions emitted and intercept an action that it is listening for. It then calls the appropriate worker saga.
- The worker saga makes an API call and dispatches an action to the reducers with the type of action and the payload.
- The reducer listens for any dispatched actions and if it matches, it then uses the supplied data to update the state in the store.
I have laid out my code to follow that flow but things aren't working quite right. Let me show my code and then i'll elaborate on the problem.
components/PostsIndex.js
ANSWER
Answered 2017-Oct-23 at 05:34Sagas do not stop actions from reaching the reducers. The saga middleware explicitly does the equivalent of:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install React-redux-saga-demo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page