Skip to content

Update throttle to use less naïve timing #7

Description

@henryqdineen

See conversation in #6

const tfn = throttle(100, fn)
tfn(); // fn();
// 99 ms later
tfn(); // setTimeout(fn, 100)

In this case the functions are executed 199ms apart while ideally you would want 100ms. I see that lodash/underscore versions of throttle are a little more intelligent about the delay provided to setTimeout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions