Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmijatovic/redux-saga-test
testing redux saga with redux hooks
https://github.com/dmijatovic/redux-saga-test
Last synced: 20 days ago
JSON representation
testing redux saga with redux hooks
- Host: GitHub
- URL: https://github.com/dmijatovic/redux-saga-test
- Owner: dmijatovic
- Created: 2020-01-15T21:30:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-29T10:42:12.000Z (about 5 years ago)
- Last Synced: 2024-11-13T16:54:10.520Z (3 months ago)
- Language: JavaScript
- Size: 344 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Redux Saga demo
This project demos redux saga possibilities. Saga uses ES6 generator functions to be able to execute chain of operations in specific order. It enables cancelling en roll-back implementation in case of errors.
The yield in SAGA works only with promise based async calls. DO NOT USE TIMEOUT as this is not promise based (it is callback based).
## Saga effects
- blocking effects
- CALL: params (fn, ...args)
- TAKE
- RACE
- CANCELLED- non-blocking effects
- PUT: equvivalent to dispatch(action)
- FORK
- SPAWN
- CANCEL
- ACTIONCHANNEL## Saga helpers
- TAKE: will only call generator function ONCE
- TAKE EVERY: catches every action dispatch and handles it
- TAKE LAST: catches every action dispatch BUT handles only last one (debounce effect). What is the delay here?## Setup
```bash
# install redux libs
npm i -s redux react-redux redux-saga```