The current default behavior is for two quick calls to result in two slow calls: one leading call and one trailing call. This is often not desirable - the point of throttling is to reduce the number of calls, not just to slow them down. For this we would need a trailing option to control trailing edge calls:
| fn() | 1 2 3 4 |
| throttle(fn, 100) | 1 3 4 |
| throttle(fn, 100, {trailing: false}) | 1 3 |
The current default behavior is for two quick calls to result in two slow calls: one leading call and one trailing call. This is often not desirable - the point of throttling is to reduce the number of calls, not just to slow them down. For this we would need a
trailingoption to control trailing edge calls: