feature(bower) rm emitify

This commit is contained in:
coderaiser 2017-04-28 15:42:40 +03:00
parent f37ad00984
commit ad65f25950
12 changed files with 2 additions and 478 deletions

1
.gitignore vendored
View file

@ -16,6 +16,7 @@ modules/fancybox/gulpfile.js
modules/jquery-mousewheel
modules/execon
modules/emitify
legacy
server_

View file

@ -17,6 +17,7 @@ modules/fancybox/demo
modules/fancybox/sprite.psd
modules/execon
modules/emitify
app.json
circle.yml

View file

@ -29,7 +29,6 @@
],
"dependencies": {
"domtokenlist-shim": "~1.1.0",
"emitify": "~2.1.1",
"findit": "^1.1.5",
"menu": "~1.0.2",
"olark": "^1.0.0",

View file

@ -1,35 +0,0 @@
{
"name": "emitify",
"homepage": "https://github.com/coderaiser/emitify",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
],
"description": "Dead simple event emitter",
"main": "dist/emitify.min.js",
"moduleType": [
"globals",
"node"
],
"keywords": [
"event",
"emitter"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"version": "2.1.1",
"_release": "2.1.1",
"_resolution": {
"type": "version",
"tag": "v2.1.1",
"commit": "7a68d0c95c1568cc84c21b76398960ea40ec29ba"
},
"_source": "https://github.com/coderaiser/emitify.git",
"_target": "^2.1.1",
"_originalSource": "emitify"
}

View file

@ -1,90 +0,0 @@
2016.07.14, v2.1.1
fix:
- (emitify) once: arguments
feature:
- (package) redrun v5.0.0
- (package) nyc v7.0.0
- (package) redrun v4.0.0
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:
- (emitify) global: lib/emitify -> dist/emitify
- (jscsrc) add
- (jshintrc) add
- (package) jscs v2.7.0
- (package) jshint v2.8.0
- (travis) node.js v5
- (package) npm-run-all v1.4.0
- (package) scripts: add coverage, report
- (package) tape v4.4.0
2015.09.30, v1.3.0
feature:
- (travis) add
- (emitify) add chaining
2015.06.16, v1.2.0
feature:
- (emitify) add instanceof check
2015.02.24, v1.1.2
fix:
- (emitify) once: do not remove callback after emit
2015.02.11, v1.1.1
fix:
- (emitify) emit throw: data -> args[0]
feature:
- (package) v1.1.0
2015.02.11, v1.1.0
feature:
- (emitify) emit: add ability to use more then two arguments
2015.02.10, v1.0.3
fix:
- (emitify) "event should be function"
2015.02.10, v1.0.2
feature:
- (emitify) add arguments check
2015.02.10, v1.0.1
fix:
- (emitify) off: index do not changed
feature:
- (bower) add

View file

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 coderaiser
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), 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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", 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.

View file

@ -1,77 +0,0 @@
# Emitify [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
Dead simple event emitter.
## Install
```
npm i emitify --save
bower i emitify --save
```
## API
What you should do first is create new instance of `emitify` with
```js
var emitify = Emitify();
```
Than you could just use API as it is.
### emitter.on(event, callback)
Add `callback` listener to `event`.
### emitter.off(event, callback)
Remove `callback` listener from `event`.
### emitter.emit(event [, data1, data2, ..., dataN])
Emit `event` with (or without) data.
### emitter.addListener(event, callback)
Alias to `emitter.on`.
### emitter.removeListener(event, callback)
Alias to `emitter.off`.
### emitter.removeAllListeners(event)
Removes all listeners related to `event`.
## How to use?
```js
var Emitify = require('emitify'),
emitter = new Emitify(),
log = function(data) {
console.log(data);
});
emitter.on('data', log);
emitter.emit('data', 'hello');
emitter.off('data', log);
```
## License
MIT
[NPMIMGURL]: https://img.shields.io/npm/v/emitify.svg?style=flat
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/emitify/master.svg?style=flat
[DependencyStatusIMGURL]: https://img.shields.io/gemnasium/coderaiser/emitify.svg?style=flat
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/emitify/badge.svg?branch=master&service=github
[NPMURL]: https://npmjs.org/package/emitify "npm"
[BuildStatusURL]: https://travis-ci.org/coderaiser/emitify "Build Status"
[DependencyStatusURL]: https://gemnasium.com/coderaiser/emitify "Dependency Status"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
[CoverageURL]: https://coveralls.io/github/coderaiser/emitify?branch=master

View file

@ -1,25 +0,0 @@
{
"name": "emitify",
"homepage": "https://github.com/coderaiser/emitify",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
],
"description": "Dead simple event emitter",
"main": "dist/emitify.min.js",
"moduleType": [
"globals",
"node"
],
"keywords": [
"event",
"emitter"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}

View file

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

View file

@ -1 +0,0 @@
!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,n,o){function r(f,u){if(!n[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=n[f]={exports:{}};t[f][0].call(l.exports,function(e){var n=t[f][1][e];return r(n?n:e)},l,l.exports,e,t,n,o)}return n[f].exports}for(var i="function"==typeof require&&require,f=0;f<o.length;f++)r(o[f]);return r}({emitify:[function(e,t,n){"use strict";function o(){return this instanceof o?void(this._all={}):new o}t.exports=o,o.prototype._check=function(e,t){var n=2===arguments.length;if("string"!=typeof e)throw Error("event should be string!");if(n&&"function"!=typeof t)throw Error("callback should be function!")},o.prototype.on=function(e,t){var n=this._all[e];return this._check(e,t),n?n.push(t):this._all[e]=[t],this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(e,t){var n=this;return n._check(e,t),n.on(e,function o(){t.apply(null,arguments),n.off(e,o)}),this},o.prototype.off=function(e,t){var n=this._all[e]||[],o=n.indexOf(t);for(this._check(e,t);~o;)n.splice(o,1),o=n.indexOf(t);return this},o.prototype.removeListener=o.prototype.off,o.prototype.emit=function(e){var t=[].slice.call(arguments,1),n=this._all[e];if(this._check(e),n)n.forEach(function(e){e.apply(null,t)});else if("error"===e)throw t[0];return this},o.prototype.removeAllListeners=function(e){return this._check(e),this._all[e]=[],this}},{}]},{},["emitify"])("emitify")});

View file

@ -1,90 +0,0 @@
'use strict';
module.exports = Emitify;
function Emitify() {
if (this instanceof Emitify)
this._all = {};
else
return new Emitify();
}
Emitify.prototype._check = function(event, callback) {
var isTwo = arguments.length === 2;
if (typeof event !== 'string')
throw Error('event should be string!');
if (isTwo && typeof callback !== 'function')
throw Error('callback should be function!');
};
Emitify.prototype.on = function(event, callback) {
var funcs = this._all[event];
this._check(event, callback);
if (funcs)
funcs.push(callback);
else
this._all[event] = [callback];
return this;
};
Emitify.prototype.addListener =
Emitify.prototype.on;
Emitify.prototype.once = function(event, callback) {
var self = this;
self._check(event, callback);
self.on(event, function fn() {
callback.apply(null, arguments);
self.off(event, fn);
});
return this;
};
Emitify.prototype.off = function(event, callback) {
var events = this._all[event] || [],
index = events.indexOf(callback);
this._check(event, callback);
while (~index) {
events.splice(index, 1);
index = events.indexOf(callback);
}
return this;
};
Emitify.prototype.removeListener =
Emitify.prototype.off;
Emitify.prototype.emit = function(event) {
var args = [].slice.call(arguments, 1),
funcs = this._all[event];
this._check(event);
if (funcs)
funcs.forEach(function(fn) {
fn.apply(null, args);
});
else if (event === 'error')
throw args[0];
return this;
};
Emitify.prototype.removeAllListeners = function(event) {
this._check(event);
this._all[event] = [];
return this;
};

View file

@ -1,44 +0,0 @@
{
"name": "emitify",
"version": "2.1.1",
"description": "dead simple event emitter",
"main": "lib/emitify.js",
"scripts": {
"test": "tape test/*.js",
"jscs": "jscs --esnext lib test",
"jshint": "jshint lib test",
"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": "redrun bundle minify",
"wisdom": "npm run build"
},
"repository": {
"type": "git",
"url": "git://github.com/coderaiser/emitify.git"
},
"keywords": [
"event",
"emitter"
],
"author": "coderaiser <mnemonic.enemy@gmail.com> (http://coderaiser.github.io/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/coderaiser/emitify/issues"
},
"homepage": "https://github.com/coderaiser/emitify",
"devDependencies": {
"browserify": "^13.0.0",
"coveralls": "^2.11.6",
"jscs": "^3.0.3",
"jshint": "^2.8.0",
"minify": "^2.0.2",
"nyc": "^7.0.0",
"redrun": "^5.0.1",
"tape": "^4.4.0"
},
"dependencies": {}
}