Skip to content

Add support for trailing:false #36

Description

@iansan5653

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 |

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions