Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
..
Failed to load latest commit information.
assets
classes
codex
files
lib-cov
modules
api.js
data.json
index.html
readme.html

readme.html

<!DOCTYPE  html>
<html>
  <head>
    <meta charset="utf-8">
    
    <title>doc</title>
    <style>
      /*github.com style (c) Vasily Polovnyov <vast@whiteants.net>*/
      pre code {
        display: block; padding: 0.5em;
        color: #333;
        background: #f8f8ff
      }
      pre .comment,
      pre .template_comment,
      pre .diff .header,
      pre .javadoc {
        color: #998;
        font-style: italic
      }
      pre .keyword,
      pre .css .rule .keyword,
      pre .winutils,
      pre .javascript .title,
      pre .nginx .title,
      pre .subst,
      pre .request,
      pre .status {
        color: #333;
        font-weight: bold
      }
      pre .number,
      pre .hexcolor,
      pre .ruby .constant {
        color: #099;
      }
      pre .string,
      pre .tag .value,
      pre .phpdoc,
      pre .tex .formula {
        color: #d14
      }
      pre .title,
      pre .id {
        color: #900;
        font-weight: bold
      }
      pre .javascript .title,
      pre .lisp .title,
      pre .clojure .title,
      pre .subst {
        font-weight: normal
      }
      pre .class .title,
      pre .haskell .type,
      pre .vhdl .literal,
      pre .tex .command {
        color: #458;
        font-weight: bold
      }
      pre .tag,
      pre .tag .title,
      pre .rules .property,
      pre .django .tag .keyword {
        color: #000080;
        font-weight: normal
      }
      pre .attribute,
      pre .variable,
      pre .lisp .body {
        color: #008080
      }
      pre .regexp {
        color: #009926
      }
      pre .class {
        color: #458;
        font-weight: bold
      }
      pre .symbol,
      pre .ruby .symbol .string,
      pre .lisp .keyword,
      pre .tex .special,
      pre .prompt {
        color: #990073
      }
      pre .built_in,
      pre .lisp .title,
      pre .clojure .built_in {
        color: #0086b3
      }
      pre .preprocessor,
      pre .pi,
      pre .doctype,
      pre .shebang,
      pre .cdata {
        color: #999;
        font-weight: bold
      }
      pre .deletion {
        background: #fdd
      }
      pre .addition {
        background: #dfd
      }
      pre .diff .change {
        background: #0086b3
      }
      pre .chunk {
        color: #aaa
      }
    </style>
  </head>
  <body>  
    <h2 id="overview">Overview</h2>
<p>Object Emitter adds Event Emitter functionality to an object, creates a new emitter, or can be used to override an existing object&#39;s emitter methods.
This is similar to the awesome EventEmitter2 module since there is wildcard support.</p>
<ul>
<li>Convenience &quot;mixin&quot; method for easily adding Emitter to any object.</li>
<li>All module methods (on, emit, off, etc) are chainable.</li>
<li>Wildcard matching enabled by default.</li>
<li>Extends existing EventEmitters by working with the _events property.</li>
<li>Recognizes Node.js domain usage.</li>
<li>Allows default &quot;error&quot; callback to avoid throwing &quot;unspecified &#39;error&#39; event&quot; error.</li>
</ul>
<h2 id="constructor-methods">Constructor Methods</h2>
<ul>
<li>create: Create a new instance of Object Emitter.</li>
<li>mixin: Add Object Emitter properties into a target object, never overwriting any existing properties.</li>
<li>inject: Force-add Object Emitter properties into the target, overwriting any existing properties if necessary.</li>
</ul>
<h2 id="basic-usage">Basic Usage</h2>
<p>Create new instance of Object Emitter.</p>
<pre><code>require( &#39;object-emitter&#39; )
  .create({ delimiter: &#39;:&#39; })
  .on( &#39;*:two&#39;, console.log )
  .emit( &#39;ping:one&#39;, &#39;I am ignored.&#39; );  
  .emit( &#39;ping:two&#39;, &#39;I am not ignored!&#39; );  </code></pre>
<p>Add Object Emitter to a new object.</p>
<pre><code>var MyObject = {};

require( &#39;object-emitter&#39; ).mixin( MyObject );    

MyObject
  .on( &#39;ping&#39;, console.log )
  .emit( &#39;ping&#39;, &#39;Chaining works!&#39; );</code></pre>
<p>Extend existing EventEmitter object and utilize wildcards.</p>
<pre><code>require( &#39;object-emitter&#39; ).mixin( process );    
process.on( &#39;*.ping&#39;, console.log );
process.emit( &#39;ding&#39;, &#39;I am ignored.&#39; );
process.emit( &#39;ding.ping&#39;, &#39;I am not ignored!&#39; );</code></pre>
<h2 id="license">License</h2>
<p>(The MIT License)</p>
<p>Copyright (c) 2013 Usability Dynamics, Inc. &lt;info@usabilitydynamics.com&gt;</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
&#39;Software&#39;), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED &#39;AS IS&#39;, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>

  </body>
</html>