Skip to content

Instantly share code, notes, and snippets.

@alexmochu
Last active July 22, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmochu/0bb9b2931913da2cf20d1d551258536c to your computer and use it in GitHub Desktop.
Save alexmochu/0bb9b2931913da2cf20d1d551258536c to your computer and use it in GitHub Desktop.
import { all, call, delay, put, takeEvery } from 'redux-saga/effects'
import { addCount } from '../counter';
export function* incrementAsync() {
yield delay(1000)
yield put(addCount(1))
}
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