Open
Description
Since fcts is on the prototype, and an object, it's shared by all instances of the same emitter class.
function Foo () {}
MicroEvent.mixin(Foo)
f = new Foo
b = new Foo
f.bind("blerg", function () { console.log("f got blerg") })
b.trigger("blerg")
Instead of putting fcts on the prototype, you must check for it on the object at the start of the bind/trigger/unbind functions and default it to {}
if it's not set or not an object.
Metadata
Metadata
Assignees
Labels
No labels