feature(bower) emitify v2.1.0

This commit is contained in:
coderaiser 2016-06-03 19:58:44 +03:00
parent 99f1c318b6
commit ac64f93d77
9 changed files with 48 additions and 17 deletions

View file

@ -35,7 +35,7 @@
"jquery": "~2.1.4",
"rendy": "~1.1.0",
"execon": "~1.2.8",
"emitify": "~2.0.0",
"emitify": "~2.1.0",
"findit": "~1.1.4",
"philip": "~1.3.2",
"menu": "~1.0.2",

View file

@ -1,6 +1,6 @@
{
"name": "emitify",
"version": "2.0.0",
"version": "2.1.0",
"homepage": "https://github.com/coderaiser/emitify",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
@ -23,14 +23,14 @@
"test",
"tests"
],
"_release": "2.0.0",
"_release": "2.1.0",
"_resolution": {
"type": "version",
"tag": "v2.0.0",
"commit": "82014823cbf1b668e08fafe3aec7fbc2efc80805"
"tag": "v2.1.0",
"commit": "f1ecef0a5c341263f9dfd49f7bc61b2a29e8aa45"
},
"_source": "git://github.com/coderaiser/emitify.git",
"_target": "~2.0.0",
"_source": "https://github.com/coderaiser/emitify.git",
"_target": "^2.1.0",
"_originalSource": "emitify",
"_direct": true
}

View file

@ -1,3 +1,14 @@
2016.06.02, v2.1.0
feature:
- (emitify) add removeAllListeners
- (travis) add node v6
- (package) npm-run-all -> redrun
- (package) jscs v3.0.3
- (package) browserify v13.0.0
- (package) nyc v6.1.1
2015.12.29, v2.0.0
feature:

View file

@ -39,6 +39,10 @@ Alias to `emitter.on`.
Alias to `emitter.off`.
### emitter.removeAllListeners(event)
Removes all listeners related to `event`.
## How to use?
```js

View file

@ -1,6 +1,6 @@
{
"name": "emitify",
"version": "2.0.0",
"version": "2.1.0",
"homepage": "https://github.com/coderaiser/emitify",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"

View file

@ -82,5 +82,13 @@ Emitify.prototype.emit = function(event) {
return this;
};
Emitify.prototype.removeAllListeners = function(event) {
this._check(event);
this._all[event] = [];
return this;
}
},{}]},{},["emitify"])("emitify")
});

View file

@ -1 +1 @@
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Emitify=e()}}(function(){return function e(t,o,n){function r(f,u){if(!o[f]){if(!t[f]){var c="function"==typeof require&&require;if(!u&&c)return c(f,!0);if(i)return i(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var p=o[f]={exports:{}};t[f][0].call(p.exports,function(e){var o=t[f][1][e];return r(o?o:e)},p,p.exports,e,t,o,n)}return o[f].exports}for(var i="function"==typeof require&&require,f=0;f<n.length;f++)r(n[f]);return r}({emitify:[function(e,t,o){"use strict";function n(){return this instanceof n?void(this._all={}):new n}t.exports=n,n.prototype._check=function(e,t){var o=2===arguments.length;if("string"!=typeof e)throw Error("event should be string!");if(o&&"function"!=typeof t)throw Error("callback should be function!")},n.prototype.on=function(e,t){var o=this._all[e];return this._check(e,t),o?o.push(t):this._all[e]=[t],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(e,t){var o=this;return o._check(e,t),o.on(e,function n(){t(),o.off(e,n)}),this},n.prototype.off=function(e,t){var o=this._all[e]||[],n=o.indexOf(t);for(this._check(e,t);~n;)o.splice(n,1),n=o.indexOf(t);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(e){var t=[].slice.call(arguments,1),o=this._all[e];if(this._check(e),o)o.forEach(function(e){e.apply(null,t)});else if("error"===e)throw t[0];return this}},{}]},{},["emitify"])("emitify")});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Emitify=e()}}(function(){return function e(t,o,n){function r(f,u){if(!o[f]){if(!t[f]){var s="function"==typeof require&&require;if(!u&&s)return s(f,!0);if(i)return i(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var l=o[f]={exports:{}};t[f][0].call(l.exports,function(e){var o=t[f][1][e];return r(o?o:e)},l,l.exports,e,t,o,n)}return o[f].exports}for(var i="function"==typeof require&&require,f=0;f<n.length;f++)r(n[f]);return r}({emitify:[function(e,t,o){"use strict";function n(){return this instanceof n?void(this._all={}):new n}t.exports=n,n.prototype._check=function(e,t){var o=2===arguments.length;if("string"!=typeof e)throw Error("event should be string!");if(o&&"function"!=typeof t)throw Error("callback should be function!")},n.prototype.on=function(e,t){var o=this._all[e];return this._check(e,t),o?o.push(t):this._all[e]=[t],this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(e,t){var o=this;return o._check(e,t),o.on(e,function n(){t(),o.off(e,n)}),this},n.prototype.off=function(e,t){var o=this._all[e]||[],n=o.indexOf(t);for(this._check(e,t);~n;)o.splice(n,1),n=o.indexOf(t);return this},n.prototype.removeListener=n.prototype.off,n.prototype.emit=function(e){var t=[].slice.call(arguments,1),o=this._all[e];if(this._check(e),o)o.forEach(function(e){e.apply(null,t)});else if("error"===e)throw t[0];return this},n.prototype.removeAllListeners=function(e){return this._check(e),this._all[e]=[],this}},{}]},{},["emitify"])("emitify")});

View file

@ -80,3 +80,11 @@ Emitify.prototype.emit = function(event) {
return this;
};
Emitify.prototype.removeAllListeners = function(event) {
this._check(event);
this._all[event] = [];
return this;
}

View file

@ -1,19 +1,19 @@
{
"name": "emitify",
"version": "2.0.0",
"version": "2.1.0",
"description": "dead simple event emitter",
"main": "lib/emitify.js",
"scripts": {
"test": "tape test/*.js",
"jscs": "jscs --esnext lib test",
"jshint": "jshint lib test",
"codestyle": "npm-run-all jshint jscs",
"codestyle": "redrun jshint jscs",
"coverage": "nyc npm test",
"report": "nyc report --reporter=text-lcov | coveralls",
"bundle:base": "browserify -s Emitify --dg false",
"bundle": "npm run bundle:base -- -r ./lib/emitify.js:emitify ./lib/emitify.js -o dist/emitify.js",
"minify": "minify dist/emitify.js > dist/emitify.min.js",
"build": "npm-run-all bundle minify",
"build": "redrun bundle minify",
"wisdom": "npm run build"
},
"repository": {
@ -31,13 +31,13 @@
},
"homepage": "https://github.com/coderaiser/emitify",
"devDependencies": {
"browserify": "~12.0.1",
"browserify": "^13.0.0",
"coveralls": "^2.11.6",
"jscs": "^2.7.0",
"jscs": "^3.0.3",
"jshint": "^2.8.0",
"minify": "~2.0.2",
"npm-run-all": "^1.4.0",
"nyc": "^5.0.1",
"minify": "^2.0.2",
"nyc": "^6.1.1",
"redrun": "^3.0.0",
"tape": "^4.4.0"
}
}