tiny-emitter
Advanced tools
Comparing version 0.1.12 to 1.0.0
{ | ||
"name": "tiny-emitter", | ||
"main": "dist/tinyemitter.js", | ||
"version": "0.1.8", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/scottcorgan/tiny-emitter", | ||
@@ -6,0 +6,0 @@ "authors": [ |
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.TinyEmitter=e()}}(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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})({1:[function(require,module,exports){ | ||
function E () { | ||
// Keep this empty so it's easier to inherit from | ||
// Keep this empty so it's easier to inherit from | ||
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) | ||
@@ -8,3 +8,3 @@ } | ||
E.prototype = { | ||
on: function (name, callback, ctx) { | ||
on: function (name, callback, ctx) { | ||
var e = this.e || (this.e = {}); | ||
@@ -32,3 +32,3 @@ | ||
var data = [].slice.call(arguments, 1); | ||
var evtArr = (this.e[name] || []).slice(); | ||
var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); | ||
var i = 0; | ||
@@ -58,2 +58,3 @@ var len = evtArr.length; | ||
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 | ||
(liveEvents.length) | ||
@@ -68,4 +69,5 @@ ? e[name] = liveEvents | ||
module.exports = E; | ||
},{}]},{},[1]) | ||
(1) | ||
}); |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.TinyEmitter=e()}}(function(){var e,n,t;return function r(e,n,t){function i(o,u){if(!n[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(f)return f(o,!0);throw new Error("Cannot find module '"+o+"'")}var s=n[o]={exports:{}};e[o][0].call(s.exports,function(n){var t=e[o][1][n];return i(t?t:n)},s,s.exports,r,e,n,t)}return n[o].exports}var f=typeof require=="function"&&require;for(var o=0;o<t.length;o++)i(t[o]);return i}({1:[function(e,n,t){function r(){}r.prototype={on:function(e,n,t){var r=this.e||(this.e={});(r[e]||(r[e]=[])).push({fn:n,ctx:t});return this},once:function(e,n,t){var r=this;var i=function(){r.off(e,i);n.apply(t,arguments)};return this.on(e,i,t)},emit:function(e){var n=[].slice.call(arguments,1);var t=(this.e[e]||[]).slice();var r=0;var i=t.length;for(r;r<i;r++){t[r].fn.apply(t[r].ctx,n)}return this},off:function(e,n){var t=this.e||(this.e={});var r=t[e];var i=[];if(r&&n){for(var f=0,o=r.length;f<o;f++){if(r[f].fn!==n)i.push(r[f])}}i.length?t[e]=i:delete t[e];return this}};n.exports=r},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.TinyEmitter=e()}}(function(){var e,n,t;return function r(e,n,t){function i(o,u){if(!n[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(f)return f(o,!0);throw new Error("Cannot find module '"+o+"'")}var s=n[o]={exports:{}};e[o][0].call(s.exports,function(n){var t=e[o][1][n];return i(t?t:n)},s,s.exports,r,e,n,t)}return n[o].exports}var f=typeof require=="function"&&require;for(var o=0;o<t.length;o++)i(t[o]);return i}({1:[function(e,n,t){function r(){}r.prototype={on:function(e,n,t){var r=this.e||(this.e={});(r[e]||(r[e]=[])).push({fn:n,ctx:t});return this},once:function(e,n,t){var r=this;var i=function(){r.off(e,i);n.apply(t,arguments)};return this.on(e,i,t)},emit:function(e){var n=[].slice.call(arguments,1);var t=((this.e||(this.e={}))[e]||[]).slice();var r=0;var i=t.length;for(r;r<i;r++){t[r].fn.apply(t[r].ctx,n)}return this},off:function(e,n){var t=this.e||(this.e={});var r=t[e];var i=[];if(r&&n){for(var f=0,o=r.length;f<o;f++){if(r[f].fn!==n)i.push(r[f])}}i.length?t[e]=i:delete t[e];return this}};n.exports=r},{}]},{},[1])(1)}); |
{ | ||
"name": "tiny-emitter", | ||
"version": "0.1.12", | ||
"version": "1.0.0", | ||
"description": "A tiny (less than 1k) event emitter library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13500
2