Skip to content

Feature Request: Add Unsubscribe All #55

@codeBelt

Description

@codeBelt

Can you add a unsubscribeAll or offAll method on the event bus so all listeners can be removed with one call?

const EventBus = createEventBus({ events: MyEvents });

EventBus.ping.on(() => { console.log("pong"); });
EventBus.say.on("michel", (words) => { console.log("michel said", words); });

// Add a unsubscribe all method
EventBus.unsubscribeAll();

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