-
Notifications
You must be signed in to change notification settings - Fork 17
/
asevented.min.js
2 lines (2 loc) · 1.16 KB
/
asevented.min.js
1
2
/*! asEvented v0.4.6 github.com/mkuklis/asEvented | Dual licensed under the MIT or GPL Version 2 licenses. */
!function(t,n,i){"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):n[t]=i()}("asEvented",this,function(){return function(){function t(t,n){var i,e,s=this.events=this.events||{},u=t.split(/\s+/),f=u.length;for(i=0;f>i;i++)s[e=u[i]]=s[e]||[],-1===r(s[e],n)&&s[e].push(n);return this}function n(t,n){var i=function(){this.unbind(t,i),n.apply(this,f.call(arguments))};return this.bind(t,i),this}function i(t,n){var i,e,s,u,f,h=this.events;if(!h)return this;for(f=t.split(/\s+/),e=0,u=f.length;u>e;e++)(i=f[e])in h!=!1&&(s=n?r(h[i],n):-1,-1!==s&&h[i].splice(s,1));return this}function e(t){var n,i,e,r=this.events;if(!r||t in r==!1)return this;for(n=f.call(arguments,1),e=r[t],i=0;i<e.length;i++)e[i].apply(this,n);return this}function r(t,n){var i,e;if(u&&t.indexOf===u)return t.indexOf(n);for(i=0,e=t.length;e>i;i++)if(t[i]===n)return i;return-1}var s=Array.prototype,u=s.indexOf,f=s.slice;return function(){return this.bind=this.on=t,this.unbind=this.off=this.removeListener=i,this.trigger=this.emit=e,this.one=this.once=n,this}}()});