From d4919f183f44b671680c8155f7e215d62ec37f6c Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Mon, 10 Sep 2012 20:15:42 -0700 Subject: [PATCH] add mixin warning --- Readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Readme.md b/Readme.md index 8f5ffd6..206108c 100644 --- a/Readme.md +++ b/Readme.md @@ -21,6 +21,11 @@ var obj = {}; Emitter(obj); Emitter(User.prototype); ``` + + __Warning__: if you use `Emitter(Some.prototype)` on a prototype + you __must__ invoke `Emitter.call(this)` in the constructor to + clear the callbacks object, otherwise events will be shared + between multiple objects. ### Emitter#on(event, fn)