You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

eventhandler.js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventhandler.js - npm Package Compare versions

Comparing version
0.1.1
to
0.1.2
+30
bower.json
{
"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
-1

@@ -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

@@ -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"
}
# EventHandler.js
A simple class for handling events
![Bower version](https://img.shields.io/bower/v/EventHandler.js.svg)
[![npm version](https://img.shields.io/npm/v/eventhandler.js.svg)](https://www.npmjs.com/package/eventhandler.js)
[![Build Status](https://travis-ci.org/murrayju/EventHandler.js.svg?branch=master)](https://travis-ci.org/murrayju/EventHandler.js)
[![Coverage Status](https://coveralls.io/repos/murrayju/EventHandler.js/badge.svg)](https://coveralls.io/r/murrayju/EventHandler.js)
[![Dependency Status](https://david-dm.org/murrayju/EventHandler.js.svg)](https://david-dm.org/murrayju/EventHandler.js)
[![devDependency Status](https://img.shields.io/david/dev/murrayju/EventHandler.js.svg)](https://david-dm.org/murrayju/EventHandler.js#info=devDependencies)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/EventHandler.svg)](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