Skip to content

Replace once, onetime, one-time #208

@43081j

Description

@43081j

These three packages:

  • once
  • onetime
  • one-time

They're somewhat useful but actually cover up bugs in many cases.

For example, some common usages in the wild are similar to the following:

const done = once(fn);

target.addEventListener('ev1', done);
target.addEventListener('ev2', done);

This actually covers up the fact that it shouldn't be possible to call the function twice in the first place. Ideally, you'd remove the listeners once one has fired, for example.

Either way, it seems most usages of these modules don't need them.

Admittedly they do provide some functionality that may be useful to some people - so this isn't a blanket removal. Rather, we should remove them from packages which don't need them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    umbrella issueThis issue contains a list of dependents of a package and tracks the progress in each

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions