Skip to content

Add "once" event hints. #6

@davidlehn

Description

@davidlehn

Some events are known to be only sent once such as startup, ready, setup, and configuration events. When these are emitted it would be good to add a hint that these are only sent once. Code could then output a warning if there is a listener that is not using once(). This would help clean up some listener resources that are not needed for the full app life.

An API might be to use an object for emit. Something like:

events.emit({name: 'myevent', once: true}, ...args)

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