dollarshaveclub / postmate

📭 A powerful, simple, promise-based postMessage library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature request] multiple callbacks for an event

Andarist opened this issue · comments

At the moment it's only possible to setup a single callback for a given event type -

this.events[eventName] = callback

I think it's really convenient to hook into a single event from multiple places (therefore with multiple callbacks). Also it would be cool to have corresponding off method, but that's a separate issue.

If you think that would be a nice addition to the library I can add it quickly, I would just use extremely small mitt (<200 B) as underlaying emitter.

@Andarist I'd love to see the PR! Thanks!!!