Ok, we have another solution now, which looks more promising.
let cacheIncrement = 0
let cacheLastIncrement = 0
export function* incrementAsync({ payload, time }) {
cacheIncrement += 1
cacheLastIncrement = time
yield call(delay, 5000)
const diff = (new Date().getTime() / 1000) - cacheLastIncrement
if (diff >= 5 && cacheIncrement > 0) {
yield put({ type: 'USER_COUNTED', value: cacheIncrement })
cacheIncrement = 0
}
}
export function* watchIncrementAsync() {
yield takeEvery('COUNT_UP', incrementAsync)
}