How do I create a leading debounce with redux-saga
问题 Is there a way to do a leading debounce? The example on the recipes only shows a trailing debounce. So below is trailing debounce example where we delay the logic fro 500ms: import { call, cancel, fork, take, delay } from 'redux-saga/effects' function* handleInput(input) { // debounce by 500ms yield delay(500) ... } function* watchInput() { let task while (true) { const { input } = yield take('INPUT_CHANGED') if (task) { yield cancel(task) } task = yield fork(handleInput, input) } } where as