Skip to content

Instantly share code, notes, and snippets.

@alexmochu
Created Jun 30, 2020
Embed
What would you like to do?
Create Sagas
import { all, call, delay, put, takeEvery } from 'redux-saga/effects'
export function* incrementAsync() {
yield delay(1000)
yield put({type: 'INCREMENT'})
}
export function* watchIncrementAsync() {
yield takeEvery('INCREMENT_ASYNC', incrementAsync)
}
// single entry point to start all Sagas at once
export default function* rootSaga() {
yield all([
call(watchIncrementAsync),
])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment