redux-saga/effects#actionChannel JavaScript Examples
The following examples show how to use
redux-saga/effects#actionChannel.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: saga.js From real-frontend with GNU General Public License v3.0 | 6 votes |
/**
*
*/
function* cacheFetchSequentialRequest(buffer, action) {
const channel = yield actionChannel(action, buffer)
while (true) {
const req = yield take(channel)
try {
const data = yield retry(3, 10000, handleCacheFetchRequest, req.payload)
yield put(actions.cacheFetchSuccess({ data }))
} catch (error) {
yield put(actions.cacheFetchFailure({ message: error.message }))
}
}
}