could we add leading/trailing edge options for debounce?
Author: ensconcedCreated May 31, 2023Updated Jun 8, 2023
Labelsenhancementquestion
This is more of a feature request than a bug. If you think this feature might make sense then maybe I will raise a PR for it.
Could we add options for debounce to configure whether the saga is called on the leading edge and/or the trailing edge? (Compare to the lodash debounce function).
This would be a very useful feature because by setting leading: true I can ensure I respond immediately to user actions without having to wait for the debounce period to expire.
Perhaps the first delayLength parameter could either be number, or an options object like { delayLength: number; leading?: boolean; trailing?: boolean }?
Source: redux-saga/redux-saga