Comparing version 0.1.0 to 0.2.0
module.exports = function (on) { | ||
var i = 0, | ||
registered = []; | ||
var add = function (handler, invocant) { | ||
var i = 0, registered = [], add = function (handler, invocant) { | ||
var ident = i++; | ||
registered[ident] = [handler, invocant || on]; | ||
var canceller = function () { delete registered[ident] }; | ||
canceller.toString = function () { return '[on.js canceller]' }; | ||
return canceller; | ||
return function () { delete registered[ident] }; | ||
}; | ||
@@ -30,6 +22,5 @@ | ||
add.toString = function () { return '[on.js emitter]' }; | ||
return add; | ||
return add; | ||
}; | ||
{ | ||
"name" : "on", | ||
"description" : "on.js is a tiny custom event library", | ||
"version" : "0.1.0", | ||
"version" : "0.2.0", | ||
"engines" : [ "node >=0.4.4" ], | ||
@@ -6,0 +6,0 @@ "author" : "Tom Yandell <tom.deletethis@yandell.me.uk> (http://tom.yandell.me.uk/blog/)", |
@@ -7,4 +7,16 @@ # on.js # | ||
Coming soon... | ||
To install using [NPM](http://npmjs.org/): | ||
npm install on | ||
To use in a browser with an [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) loader (e.g. [RequireJS](http://requirejs.org/), download one of the following releases: | ||
* [Minified with module ID](http://todo/) (recommended) | ||
* [Minified without module ID](http://todo/) | ||
Unminified versions are provided for debugging purposes: | ||
* [Unminified with module ID](http://todo/) | ||
* [Unminified without module ID](http://todo/) | ||
## Loading on.js ## | ||
@@ -11,0 +23,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7
138
7927
54