From 5d25dd601172d1015645e29ac91aecc1ce05f98a Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Wed, 5 Sep 2012 22:08:48 -0700 Subject: [PATCH] add mixin docs --- Readme.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Readme.md b/Readme.md index 2118be0..8f5ffd6 100644 --- a/Readme.md +++ b/Readme.md @@ -9,6 +9,18 @@ $ component install component/emitter ``` ## API + +### Emitter(obj) + + The `Emitter` may also be used as a mixin. For example + a "plain" object may become an emitter, or you may + extend an existing prototype: + +```js +var obj = {}; +Emitter(obj); +Emitter(User.prototype); +``` ### Emitter#on(event, fn)