eventhandler.js
Advanced tools
+30
| { | ||
| "name": "EventHandler.js", | ||
| "description": "A simple class for handling events", | ||
| "keywords": [ | ||
| "js", | ||
| "event" | ||
| ], | ||
| "homepage": "https://github.com/murrayju/EventHandler.js", | ||
| "license": "MIT", | ||
| "main": [ | ||
| "dist/EventHandler.min.js" | ||
| ], | ||
| "ignore": [ | ||
| "/.*", | ||
| "*.templ.json", | ||
| "test", | ||
| "build.*" | ||
| ], | ||
| "devDependencies": { | ||
| "coffee-script": "1", | ||
| "requirejs": "2", | ||
| "require-cs": "0.5" | ||
| }, | ||
| "exportsOverride": { | ||
| "coffee-script": { | ||
| "extras": "extras/*" | ||
| } | ||
| }, | ||
| "version": "0.1.2+0.master.dcc0ae6647a8" | ||
| } |
| { | ||
| "major": 0, | ||
| "minor": 1, | ||
| "patch": 2 | ||
| } |
@@ -1,2 +0,2 @@ | ||
| /*! eventhandler.js v0.1.1+0.master.780e61431a1d | (c) 2015 Justin Murray | built on 2015-06-19 */ | ||
| /*! eventhandler.js v0.1.2+0.master.dcc0ae6647a8 | (c) 2015 Justin Murray | built on 2015-06-19 */ | ||
@@ -3,0 +3,0 @@ (function() { |
@@ -0,0 +0,0 @@ { |
@@ -1,4 +0,4 @@ | ||
| /*! eventhandler.js v0.1.1+0.master.780e61431a1d | (c) 2015 Justin Murray | built on 2015-06-19 */ | ||
| /*! eventhandler.js v0.1.2+0.master.dcc0ae6647a8 | (c) 2015 Justin Murray | built on 2015-06-19 */ | ||
| (function(){var a=[].slice;!function(a,b){return"function"==typeof define&&null!=define.amd?define([],b):"object"==typeof exports?module.exports=b():a.EventHandler=b()}(this,function(){var b;return b=function(){function b(a,b,c){this.firesOnce=null!=a?a:!1,this.fireAtReg=null!=b?b:!1,this.fireAtRegArgs=null!=c?c:[],this.list=[],this.fireNow=!1}return b.prototype.fire=function(){var b,c,d,e,f;for(b=1<=arguments.length?a.call(arguments,0):[],f=this.list,d=0,e=f.length;e>d;d++)c=f[d],c.apply(this,b);return this.fireNow=this.firesOnce},b.prototype.fireAsync=function(){var b,c,d,e,f;for(b=1<=arguments.length?a.call(arguments,0):[],f=this.list,d=0,e=f.length;e>d;d++)c=f[d],setTimeout(function(a){return function(){return c.apply(a,b)}}(this),0);return this.fireNow=this.firesOnce},b.prototype.emit=b.prototype.fire,b.prototype.emitAsync=b.prototype.fireAsync,b.prototype.on=function(a){var b;return this.list.push(a),(this.fireNow||("function"==typeof this.fireAtReg?this.fireAtReg():void 0)||this.fireAtReg===!0)&&setTimeout(function(b){return function(){return a.apply(b,b.fireAtRegArgs)}}(this),0),b={fn:a,evt:this,off:function(){return b.evt.off(b.fn)}}},b.prototype.off=function(a){var b;return null!=a?this.list=function(){var c,d,e,f;for(e=this.list,f=[],c=0,d=e.length;d>c;c++)b=e[c],b!==a&&f.push(b);return f}.call(this):this.list.length=0},b}()})}).call(this); | ||
| //# sourceMappingURL=EventHandler.min.js.map |
+1
-6
@@ -11,7 +11,2 @@ { | ||
| "main": "dist/EventHandler.min.js", | ||
| "files": [ | ||
| "dist", | ||
| "src/*.coffee", | ||
| "LICENSE" | ||
| ], | ||
| "bugs": { | ||
@@ -60,3 +55,3 @@ "url": "https://github.com/murrayju/EventHandler.js/issues" | ||
| }, | ||
| "version": "0.1.1+0.master.780e61431a1d" | ||
| "version": "0.1.2+0.master.dcc0ae6647a8" | ||
| } |
+31
-3
| # EventHandler.js | ||
| A simple class for handling events | ||
|  | ||
| [](https://www.npmjs.com/package/eventhandler.js) | ||
| [](https://travis-ci.org/murrayju/EventHandler.js) | ||
| [](https://coveralls.io/r/murrayju/EventHandler.js) | ||
| [](https://david-dm.org/murrayju/EventHandler.js) | ||
| [](https://david-dm.org/murrayju/EventHandler.js#info=devDependencies) | ||
| [](https://saucelabs.com/u/EventHandler) | ||
| A simple class for handling events | ||
| ## Quick start | ||
| Several options are available to get started: | ||
| - [Download the latest release](https://github.com/murrayju/EventHandler.js/releases/download/v0.1.1/eventhandler.js-0.1.1.33.HEAD.c219b8d8cd2d.zip). | ||
| - Clone the repo: `git clone https://github.com/murrayju/EventHandler.js.git`. | ||
| - Install with [Bower](http://bower.io): `bower install EventHandler.js`. | ||
| - Install with [npm](https://www.npmjs.com): `npm install eventhandler.js`. | ||
| ## Example | ||
| ```js | ||
| var evt = new EventHandler(); | ||
| // Register a listener for this event | ||
| var handler = evt.on(function (someArg) { | ||
| console.log('Event fired with arg: ' + someArg); | ||
| }); | ||
| // Fire the event | ||
| evt.fire('test data'); | ||
| // Unregister the listener when no longer needed | ||
| handler.off(); | ||
| ``` | ||
| #### Credits | ||
| <a href="https://www.browserstack.com/automate/"><img alt="BrowserStack" src="http://www.xml2selenium.com/wp-content/uploads/2014/01/BrowserStackLogo.png" height="30px"/></a><br/> | ||
| A big thanks to BrowserStack for providing automated cross-browser testing! |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
10
11.11%130
35.42%41
215.38%14448
-14.23%