redux saga delay code example
Example: redux saga delay
const delay = (ms) => new Promise(res => setTimeout(res, ms))
export function* incrementAsync() {
yield delay(1000)
yield put({type: 'INCREMENT'})
}
const delay = (ms) => new Promise(res => setTimeout(res, ms))
export function* incrementAsync() {
yield delay(1000)
yield put({type: 'INCREMENT'})
}