From fd17d467ff30c078cb1549ebfa5c077f55c503f0 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 12:01:50 -0700 Subject: [PATCH 01/11] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 34374e7..2fb9d63 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## Event Sky (event-sky) -An event aggregate utility for front-end apps. +An event pub/sub aggregate utility for javascript apps. -When designing front-end apps it's best to keep modules/features loosely coupled. A great method for accomplishing this is events. "Event Sky" was designed to help your apps work without knowing about eachother by utilizing the events with Event Sky. +When designing javascript apps it's best to keep modules/features loosely coupled. A great method for accomplishing this is events via publish/subscribe handlers. "Event Sky" was designed to help your apps work without knowing about eachother by utilizing the events with Event Sky. [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) From 1043e30512a3643a6a15e8cb013e9bc60e9f555d Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 13:54:14 -0700 Subject: [PATCH 02/11] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2fb9d63..b49d647 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,16 @@ An event pub/sub aggregate utility for javascript apps. When designing javascript apps it's best to keep modules/features loosely coupled. A great method for accomplishing this is events via publish/subscribe handlers. "Event Sky" was designed to help your apps work without knowing about eachother by utilizing the events with Event Sky. -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) + [![npm version](https://badge.fury.io/js/event-sky.svg)](https://badge.fury.io/js/event-sky) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) + +[![Build Status](https://travis-ci.org/crobinson42/event-sky.svg?branch=master)](https://travis-ci.org/crobinson42/event-sky) +[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) + +[![forthebadge](https://img.shields.io/badge/CommonJs-yellow.svg)](http://nodejs.org) +[![forthebadge](https://img.shields.io/badge/Browser-orange.svg)](http://nodejs.org) + +[![forthebadge](https://img.shields.io/badge/Mom%20Made-Pizza%20Rolls-blue.svg)](http://pizza.com) An event pub-sub aggregate utility for javascript environments. From 6abe81cb04b1bd242e31a852832ffbffd8e456df Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 13:55:30 -0700 Subject: [PATCH 03/11] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b49d647..e1afe28 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ When designing javascript apps it's best to keep modules/features loosely couple [![Build Status](https://travis-ci.org/crobinson42/event-sky.svg?branch=master)](https://travis-ci.org/crobinson42/event-sky) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) -[![forthebadge](https://img.shields.io/badge/CommonJs-yellow.svg)](http://nodejs.org) -[![forthebadge](https://img.shields.io/badge/Browser-orange.svg)](http://nodejs.org) +[![forthebadge](https://img.shields.io/badge/Module-CommonJs-green.svg)](http://pizza.com) +[![forthebadge](https://img.shields.io/badge/Browser-EventSky-orange.svg)](http://pizza.com) [![forthebadge](https://img.shields.io/badge/Mom%20Made-Pizza%20Rolls-blue.svg)](http://pizza.com) From f7e0513011ce5bca8dd7b397c8fdb68d8f373b82 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 13:56:21 -0700 Subject: [PATCH 04/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1afe28..9380b05 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ An event pub/sub aggregate utility for javascript apps. When designing javascript apps it's best to keep modules/features loosely coupled. A great method for accomplishing this is events via publish/subscribe handlers. "Event Sky" was designed to help your apps work without knowing about eachother by utilizing the events with Event Sky. - [![npm version](https://badge.fury.io/js/event-sky.svg)](https://badge.fury.io/js/event-sky) +[![npm version](https://badge.fury.io/js/event-sky.svg)](https://badge.fury.io/js/event-sky)] [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Build Status](https://travis-ci.org/crobinson42/event-sky.svg?branch=master)](https://travis-ci.org/crobinson42/event-sky) From 13b5ada9301987d4d45f73ef6854a65881ccf5f8 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 13:56:29 -0700 Subject: [PATCH 05/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9380b05..d72e020 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ An event pub/sub aggregate utility for javascript apps. When designing javascript apps it's best to keep modules/features loosely coupled. A great method for accomplishing this is events via publish/subscribe handlers. "Event Sky" was designed to help your apps work without knowing about eachother by utilizing the events with Event Sky. -[![npm version](https://badge.fury.io/js/event-sky.svg)](https://badge.fury.io/js/event-sky)] +[![npm version](https://badge.fury.io/js/event-sky.svg)](https://badge.fury.io/js/event-sky) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Build Status](https://travis-ci.org/crobinson42/event-sky.svg?branch=master)](https://travis-ci.org/crobinson42/event-sky) From ea54fd6725fc6171191837a2d4ea36bff13d5e89 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 14:09:41 -0700 Subject: [PATCH 06/11] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d72e020..ff59822 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,10 @@ An event pub/sub aggregate utility for javascript apps. When designing javascript apps it's best to keep modules/features loosely coupled. A great method for accomplishing this is events via publish/subscribe handlers. "Event Sky" was designed to help your apps work without knowing about eachother by utilizing the events with Event Sky. [![npm version](https://badge.fury.io/js/event-sky.svg)](https://badge.fury.io/js/event-sky) +[![Build Status](https://travis-ci.org/crobinson42/event-sky.svg?branch=master)](https://travis-ci.org/crobinson42/event-sky) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) -[![Build Status](https://travis-ci.org/crobinson42/event-sky.svg?branch=master)](https://travis-ci.org/crobinson42/event-sky) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) - [![forthebadge](https://img.shields.io/badge/Module-CommonJs-green.svg)](http://pizza.com) [![forthebadge](https://img.shields.io/badge/Browser-EventSky-orange.svg)](http://pizza.com) From 8d2bfc5723fa7732d3eef43b4b3fa2f0f74c424c Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 15:52:02 -0700 Subject: [PATCH 07/11] fix(): binding context to main class methods --- build.js | 2 +- build.js.map | 2 +- src/main.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.js b/build.js index 4607e7c..a676638 100644 --- a/build.js +++ b/build.js @@ -1,2 +1,2 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.EventSky=n()}(this,function(){"use strict";function e(e){return e&&e.__esModule?e.default:e}function n(e,n){return n={exports:{}},e(n,n.exports),n.exports}var t=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},r=function(e){return Object(t(e))},o={}.hasOwnProperty,i=function(e,n){return o.call(e,n)},u={}.toString,a=function(e){return u.call(e).slice(8,-1)},c=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==a(e)?e.split(""):Object(e)},f=function(e){return c(t(e))},s=Math.ceil,l=Math.floor,h=function(e){return isNaN(e=+e)?0:(e>0?l:s)(e)},d=Math.min,v=function(e){return e>0?d(h(e),9007199254740991):0},p=Math.max,y=Math.min,_=function(e,n){return e=h(e),e<0?p(e+n,0):y(e,n)},b=n(function(e){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)}),g=b["__core-js_shared__"]||(b["__core-js_shared__"]={}),E=0,m=Math.random(),w=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++E+m).toString(36))},S=function(e){return g[e]||(g[e]={})}("keys"),O=function(e){return function(n,t,r){var o,i=f(n),u=v(i.length),a=_(r,u);if(e&&t!=t){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((e||a in i)&&i[a]===t)return e||a||0;return!e&&-1}}(!1),k=function(e){return S[e]||(S[e]=w(e))}("IE_PROTO"),j=function(e,n){var t,r=f(e),o=0,u=[];for(t in r)t!=k&&i(r,t)&&u.push(t);for(;n.length>o;)i(r,t=n[o++])&&(~O(u,t)||u.push(t));return u},M="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),x=Object.keys||function(e){return j(e,M)},A=n(function(e){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)}),P=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},F=function(e,n,t){if(P(e),void 0===n)return e;switch(t){case 1:return function(t){return e.call(n,t)};case 2:return function(t,r){return e.call(n,t,r)};case 3:return function(t,r,o){return e.call(n,t,r,o)}}return function(){return e.apply(n,arguments)}},H=function(e){return"object"==typeof e?null!==e:"function"==typeof e},I=function(e){if(!H(e))throw TypeError(e+" is not an object!");return e},N=function(e){try{return!!e()}catch(e){return!0}},T=!N(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),W=b.document,C=H(W)&&H(W.createElement),R=function(e){return C?W.createElement(e):{}},B=!T&&!N(function(){return 7!=Object.defineProperty(R("div"),"a",{get:function(){return 7}}).a}),D=function(e,n){if(!H(e))return e;var t,r;if(n&&"function"==typeof(t=e.toString)&&!H(r=t.call(e)))return r;if("function"==typeof(t=e.valueOf)&&!H(r=t.call(e)))return r;if(!n&&"function"==typeof(t=e.toString)&&!H(r=t.call(e)))return r;throw TypeError("Can't convert object to primitive value")},G=Object.defineProperty,z=T?Object.defineProperty:function(e,n,t){if(I(e),n=D(n,!0),I(t),B)try{return G(e,n,t)}catch(e){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(e[n]=t.value),e},L={f:z},U=function(e,n){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:n}},q=T?function(e,n,t){return L.f(e,n,U(1,t))}:function(e,n,t){return e[n]=t,e},J=function(e,n,t){var r,o,i,u=e&J.F,a=e&J.G,c=e&J.S,f=e&J.P,s=e&J.B,l=e&J.W,h=a?A:A[n]||(A[n]={}),d=h.prototype,v=a?b:c?b[n]:(b[n]||{}).prototype;a&&(t=n);for(r in t)(o=!u&&v&&void 0!==v[r])&&r in h||(i=o?v[r]:t[r],h[r]=a&&"function"!=typeof v[r]?t[r]:s&&o?F(i,b):l&&v[r]==i?function(e){var n=function(n,t,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,t)}return new e(n,t,r)}return e.apply(this,arguments)};return n.prototype=e.prototype,n}(i):f&&"function"==typeof i?F(Function.call,i):i,f&&((h.virtual||(h.virtual={}))[r]=i,e&J.R&&d&&!d[r]&&q(d,r,i)))};J.F=1,J.G=2,J.S=4,J.P=8,J.B=16,J.W=32,J.U=64,J.R=128;var K=J;!function(e,n){var t=(A.Object||{})[e]||Object[e],r={};r[e]=n(t),K(K.S+K.F*N(function(){t(1)}),"Object",r)}("keys",function(){return function(e){return x(r(e))}});var Q=A.Object.keys,V=n(function(e){e.exports={default:Q,__esModule:!0}}),X=e(V),Y=n(function(e,n){n.__esModule=!0,n.default=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}}),Z=e(Y);K(K.S+K.F*!T,"Object",{defineProperty:L.f});var $=A.Object,ee=function(e,n,t){return $.defineProperty(e,n,t)},ne=n(function(e){e.exports={default:ee,__esModule:!0}}),te=n(function(e,n){n.__esModule=!0;var t=function(e){return e&&e.__esModule?e:{default:e}}(ne);n.default=function(){function e(e,n){for(var r=0;r> "+e):null},this.on=this._utils.curryWhenHandler.bind(this)("on"),this.once=this._utils.curryWhenHandler.bind(this)("once"),this.beforeAll=this._utils.curryWhenHandler.bind(this)("beforeAll"),this.afterAll=this._utils.curryWhenHandler.bind(this)("afterAll"),this.off.all=this.allOff.bind(this)}return re(e,[{key:"off",value:function(e,n){var t=this;return X(this.events).forEach(function(r){X(t.events[r]).forEach(function(o){["beforeAll","on","once","afterAll"].includes(o)&&X(t.events[r][o]).forEach(function(i){var u=t.events[r][o][i]===n&&r===e,a=!n&&i===e;(u||a)&&(delete t.events[r][o][i],t.events[r].handlers--)})})}),this}},{key:"allOff",value:function(e){return delete this.events[e],this._firehose('.off.all("'+e+'") removed all event handlers'),this.events[e]=this._utils.createNewEventMap(),this}},{key:"trigger",value:function(e,n){if(!this._utils.validateEventName(this,e))return this;if(!this.events[e])return this._firehose('"'+e+'" triggered with no handlers setup'),this;this._firehose('"'+e+'" triggered');var t=this.events[e].beforeAll;X(t).forEach(function(o){try{t[o](n)}catch(i){t[o]?console.error("EventSky error: .beforeAll('"+e+"', "+(r[o].name||"anonymous")+") handler trapped an error",{error:i,data:n}):console.error("EventSky error: .beforeAll('"+e+"', ...) handler does not exist",{eventId:o,data:n})}});var r=this.events[e].on;X(r).forEach(function(t){try{r[t](n)}catch(o){r[t]?console.error("EventSky error: .on('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .on('"+e+"', ...) handler does not exist",{eventId:t,data:n})}});var o=this.events[e].once;X(o).forEach(function(t){try{o[t](n)}catch(i){o[t]?console.error("EventSky error: .once('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:i,data:n}):console.error("EventSky error: .once('"+e+"', ...) handler does not exist",{eventId:t,data:n})}});var i=this.events[e].afterAll;return X(i).forEach(function(t){try{i[t](n)}catch(o){i[t]?console.error("EventSky error: .afterAll('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .afterAll('"+e+"', ...) handler does not exist",{eventId:t,data:n})}}),this}}]),e}())}); +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.EventSky=n()}(this,function(){"use strict";function e(e){return e&&e.__esModule?e.default:e}function n(e,n){return n={exports:{}},e(n,n.exports),n.exports}var t=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},r=function(e){return Object(t(e))},o={}.hasOwnProperty,i=function(e,n){return o.call(e,n)},u={}.toString,a=function(e){return u.call(e).slice(8,-1)},c=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==a(e)?e.split(""):Object(e)},f=function(e){return c(t(e))},s=Math.ceil,l=Math.floor,h=function(e){return isNaN(e=+e)?0:(e>0?l:s)(e)},d=Math.min,v=function(e){return e>0?d(h(e),9007199254740991):0},p=Math.max,y=Math.min,_=function(e,n){return e=h(e),e<0?p(e+n,0):y(e,n)},b=n(function(e){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)}),g=b["__core-js_shared__"]||(b["__core-js_shared__"]={}),E=0,m=Math.random(),w=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++E+m).toString(36))},S=function(e){return g[e]||(g[e]={})}("keys"),O=function(e){return function(n,t,r){var o,i=f(n),u=v(i.length),a=_(r,u);if(e&&t!=t){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((e||a in i)&&i[a]===t)return e||a||0;return!e&&-1}}(!1),j=function(e){return S[e]||(S[e]=w(e))}("IE_PROTO"),k=function(e,n){var t,r=f(e),o=0,u=[];for(t in r)t!=j&&i(r,t)&&u.push(t);for(;n.length>o;)i(r,t=n[o++])&&(~O(u,t)||u.push(t));return u},M="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),x=Object.keys||function(e){return k(e,M)},A=n(function(e){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)}),P=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},F=function(e,n,t){if(P(e),void 0===n)return e;switch(t){case 1:return function(t){return e.call(n,t)};case 2:return function(t,r){return e.call(n,t,r)};case 3:return function(t,r,o){return e.call(n,t,r,o)}}return function(){return e.apply(n,arguments)}},H=function(e){return"object"==typeof e?null!==e:"function"==typeof e},I=function(e){if(!H(e))throw TypeError(e+" is not an object!");return e},N=function(e){try{return!!e()}catch(e){return!0}},T=!N(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),W=b.document,C=H(W)&&H(W.createElement),R=function(e){return C?W.createElement(e):{}},B=!T&&!N(function(){return 7!=Object.defineProperty(R("div"),"a",{get:function(){return 7}}).a}),D=function(e,n){if(!H(e))return e;var t,r;if(n&&"function"==typeof(t=e.toString)&&!H(r=t.call(e)))return r;if("function"==typeof(t=e.valueOf)&&!H(r=t.call(e)))return r;if(!n&&"function"==typeof(t=e.toString)&&!H(r=t.call(e)))return r;throw TypeError("Can't convert object to primitive value")},G=Object.defineProperty,z=T?Object.defineProperty:function(e,n,t){if(I(e),n=D(n,!0),I(t),B)try{return G(e,n,t)}catch(e){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(e[n]=t.value),e},L={f:z},U=function(e,n){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:n}},q=T?function(e,n,t){return L.f(e,n,U(1,t))}:function(e,n,t){return e[n]=t,e},J=function(e,n,t){var r,o,i,u=e&J.F,a=e&J.G,c=e&J.S,f=e&J.P,s=e&J.B,l=e&J.W,h=a?A:A[n]||(A[n]={}),d=h.prototype,v=a?b:c?b[n]:(b[n]||{}).prototype;a&&(t=n);for(r in t)(o=!u&&v&&void 0!==v[r])&&r in h||(i=o?v[r]:t[r],h[r]=a&&"function"!=typeof v[r]?t[r]:s&&o?F(i,b):l&&v[r]==i?function(e){var n=function(n,t,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,t)}return new e(n,t,r)}return e.apply(this,arguments)};return n.prototype=e.prototype,n}(i):f&&"function"==typeof i?F(Function.call,i):i,f&&((h.virtual||(h.virtual={}))[r]=i,e&J.R&&d&&!d[r]&&q(d,r,i)))};J.F=1,J.G=2,J.S=4,J.P=8,J.B=16,J.W=32,J.U=64,J.R=128;var K=J;!function(e,n){var t=(A.Object||{})[e]||Object[e],r={};r[e]=n(t),K(K.S+K.F*N(function(){t(1)}),"Object",r)}("keys",function(){return function(e){return x(r(e))}});var Q=A.Object.keys,V=n(function(e){e.exports={default:Q,__esModule:!0}}),X=e(V),Y=n(function(e,n){n.__esModule=!0,n.default=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}}),Z=e(Y);K(K.S+K.F*!T,"Object",{defineProperty:L.f});var $=A.Object,ee=function(e,n,t){return $.defineProperty(e,n,t)},ne=n(function(e){e.exports={default:ee,__esModule:!0}}),te=n(function(e,n){n.__esModule=!0;var t=function(e){return e&&e.__esModule?e:{default:e}}(ne);n.default=function(){function e(e,n){for(var r=0;r> "+e):null},this.on=this._utils.curryWhenHandler.bind(this)("on"),this.once=this._utils.curryWhenHandler.bind(this)("once"),this.beforeAll=this._utils.curryWhenHandler.bind(this)("beforeAll"),this.afterAll=this._utils.curryWhenHandler.bind(this)("afterAll"),this.off.all=this.allOff.bind(this)}return re(e,[{key:"allOff",value:function(e){return delete this.events[e],this._firehose('.off.all("'+e+'") removed all event handlers'),this.events[e]=this._utils.createNewEventMap(),this}},{key:"trigger",value:function(e,n){if(!this._utils.validateEventName(this,e))return this;if(!this.events[e])return this._firehose('"'+e+'" triggered with no handlers setup'),this;this._firehose('"'+e+'" triggered');var t=this.events[e].beforeAll;X(t).forEach(function(o){try{t[o](n)}catch(i){t[o]?console.error("EventSky error: .beforeAll('"+e+"', "+(r[o].name||"anonymous")+") handler trapped an error",{error:i,data:n}):console.error("EventSky error: .beforeAll('"+e+"', ...) handler does not exist",{eventId:o,data:n})}});var r=this.events[e].on;X(r).forEach(function(t){try{r[t](n)}catch(o){r[t]?console.error("EventSky error: .on('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .on('"+e+"', ...) handler does not exist",{eventId:t,data:n})}});var o=this.events[e].once;X(o).forEach(function(t){try{o[t](n)}catch(i){o[t]?console.error("EventSky error: .once('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:i,data:n}):console.error("EventSky error: .once('"+e+"', ...) handler does not exist",{eventId:t,data:n})}});var i=this.events[e].afterAll;return X(i).forEach(function(t){try{i[t](n)}catch(o){i[t]?console.error("EventSky error: .afterAll('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .afterAll('"+e+"', ...) handler does not exist",{eventId:t,data:n})}}),this}}]),e}())}); //# sourceMappingURL=build.js.map diff --git a/build.js.map b/build.js.map index 122f936..4292dda 100644 --- a/build.js.map +++ b/build.js.map @@ -1 +1 @@ -{"version":3,"file":"build.js","sources":["node_modules/core-js/library/modules/_defined.js","node_modules/core-js/library/modules/_to-object.js","node_modules/core-js/library/modules/_has.js","node_modules/core-js/library/modules/_cof.js","node_modules/core-js/library/modules/_iobject.js","node_modules/core-js/library/modules/_to-iobject.js","node_modules/core-js/library/modules/_to-integer.js","node_modules/core-js/library/modules/_to-length.js","node_modules/core-js/library/modules/_to-index.js","node_modules/core-js/library/modules/_global.js","node_modules/core-js/library/modules/_shared.js","node_modules/core-js/library/modules/_uid.js","node_modules/core-js/library/modules/_shared-key.js","node_modules/core-js/library/modules/_object-keys-internal.js","node_modules/core-js/library/modules/_array-includes.js","node_modules/core-js/library/modules/_enum-bug-keys.js","node_modules/core-js/library/modules/_object-keys.js","node_modules/core-js/library/modules/_core.js","node_modules/core-js/library/modules/_a-function.js","node_modules/core-js/library/modules/_ctx.js","node_modules/core-js/library/modules/_is-object.js","node_modules/core-js/library/modules/_an-object.js","node_modules/core-js/library/modules/_fails.js","node_modules/core-js/library/modules/_descriptors.js","node_modules/core-js/library/modules/_dom-create.js","node_modules/core-js/library/modules/_ie8-dom-define.js","node_modules/core-js/library/modules/_to-primitive.js","node_modules/core-js/library/modules/_object-dp.js","node_modules/core-js/library/modules/_property-desc.js","node_modules/core-js/library/modules/_hide.js","node_modules/core-js/library/modules/_export.js","node_modules/core-js/library/modules/_object-sap.js","node_modules/core-js/library/modules/es6.object.keys.js","node_modules/core-js/library/fn/object/keys.js","node_modules/babel-runtime/core-js/object/keys.js","node_modules/babel-runtime/helpers/classCallCheck.js","node_modules/core-js/library/modules/es6.object.define-property.js","node_modules/core-js/library/fn/object/define-property.js","node_modules/babel-runtime/core-js/object/define-property.js","node_modules/babel-runtime/helpers/createClass.js","src/utils.js","src/main.js"],"sourcesContent":["// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var global = require('./_global')\n , core = require('./_core')\n , ctx = require('./_ctx')\n , hide = require('./_hide')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , IS_WRAP = type & $export.W\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE]\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]\n , key, own, out;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if(own && key in exports)continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function(C){\n var F = function(a, b, c){\n if(this instanceof C){\n switch(arguments.length){\n case 0: return new C;\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if(IS_PROTO){\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f});","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc){\n return $Object.defineProperty(it, key, desc);\n};","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();","// utility methods for EventSky\n\nexport default {\n\t/**\n\t * This provides a format for event map objects\n\t * @returns {{}}\n\t */\n\tcreateNewEventMap (eventName) {\n\t\treturn {\n\t\t\t// aggregate number of handlers for this event\n\t\t\thandlers: 0,\n\t\t\t_handlers: 0,\n\t\t\t_name: eventName,\n\t\t\ton: {},\n\t\t\tonce: {},\n\t\t\tbeforeAll: {},\n\t\t\tafterAll: {},\n\t\t}\n\t},\n\n\t/**\n\t * Utility used to setup 'when' handlers on parent class\n\t * @param when {string} 'on', 'beforeAll', etc.\n\t * @return function\n\t */\n\tcurryWhenHandler (when) {\n\t\treturn (event, handler) => {\n\t\t\t// verify params\n\t\t\tif (typeof event !== 'string' || event.length < 1 || typeof handler !== 'function') {\n\t\t\t\tconsole.warn(`EventSky warning: \"${event}\" event must be a string and handler must be a function - not set with .${when} handler`)\n\n\t\t\t\treturn this\n\t\t\t}\n\n\t\t\t// ensure the event exists and is setup on the event store\n\t\t\tif (!this.events[event]) {\n\t\t\t\tthis.events[event] = this._utils.createNewEventMap(event)\n\t\t\t}\n\n\t\t\t// check if the event and handler are a duplicate\n\t\t\tif (this.events[event][when] && this.events[event][when] === handler) {\n\t\t\t\tif (!this.config.ignoreDuplicateHandler) {\n\t\t\t\t\tconsole.warn(`EventSky warning: duplicate handler for .${when}('${event}')`)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.events[event].handlers++\n\t\t\tconst _handlerCount = this.events[event]._handlers++\n\t\t\tconst eventId = `id_${event}.${when}.${_handlerCount}`\n\t\t\tthis.events[event][when][eventId] = handler\n\n\t\t\treturn eventId\n\t\t}\n\t},\n\n\tvalidateEventName (context, eventName) {\n\t\tif (!context) {\n\t\t\treturn console.error('EventSky._utils needs to be passed a valid context param')\n\t\t} else if (!eventName || typeof eventName !== 'string') {\n\t\t\tconsole.error('EventSky error: .trigger(event) did not receive a string param')\n\n\t\t\treturn false\n\t\t}\n\n\t\treturn true\n\t},\n}\n","import utils from './utils'\n\nclass EventSky {\n\tconstructor () {\n\t\tthis.config = {\n\t\t\tfirehose: false,\n\t\t\tignoreDuplicateHandler: false, // warns about duplicate event/handler\n\t\t}\n\n\t\tthis._utils = utils\n\n\t\t// map of events\n\t\tthis.events = {}\n\t\tthis._firehose = msg => this.config.firehose ? console.log(`EventSky Firehose >> ${msg}`) : null\n\n\t\t// setup 'when' event handlers\n\t\tthis.on = this._utils.curryWhenHandler.bind(this)('on')\n\t\tthis.once = this._utils.curryWhenHandler.bind(this)('once')\n\t\tthis.beforeAll = this._utils.curryWhenHandler.bind(this)('beforeAll')\n\t\tthis.afterAll = this._utils.curryWhenHandler.bind(this)('afterAll')\n\n\t\t// extend a chain call for eventSky.off.all()\n\t\tthis.off.all = this.allOff.bind(this)\n\t}\n\n\t/**\n\t * Remove a handler for an event, the first parameter can be and event name\n\t * or an eventId to be removed.\n\t * @param eventOrId\n\t * @param handler\n\t * @returns {EventSky}\n\t */\n\toff (eventOrId, handler) {\n\t\t// iterate all events by names\n\t\tObject.keys(this.events).forEach(_eventName => {\n\t\t\t// iterate each 'when' event lifecycle and look for eventId or handler to remove\n\t\t\tObject.keys(this.events[_eventName]).forEach(_eventWhen => {\n\t\t\t\tif (!['beforeAll', 'on', 'once', 'afterAll'].includes(_eventWhen)) return\n\n\t\t\t\t// iterate each event of the current 'when' for event\n\t\t\t\tObject.keys(this.events[_eventName][_eventWhen]).forEach(_eventId => {\n\t\t\t\t\tconst eventNameAndHandlerMatch = (\n\t\t\t\t\t\t\tthis.events[_eventName][_eventWhen][_eventId] === handler &&\n\t\t\t\t\t\t\t_eventName === eventOrId\n\t\t\t\t\t\t)\n\t\t\t\t\tconst eventIdMatch = (!handler && _eventId === eventOrId)\n\n\t\t\t\t\tconst performDelete = (\n\t\t\t\t\t\t\teventNameAndHandlerMatch ||\n\t\t\t\t\t\t\teventIdMatch\n\t\t\t\t\t\t)\n\n\t\t\t\t\tif (performDelete) {\n\t\t\t\t\t\tdelete this.events[_eventName][_eventWhen][_eventId]\n\t\t\t\t\t\tthis.events[_eventName].handlers--\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Turn off all handlers for an event name\n\t * @param eventName {string} the name of the event\n\t * @returns {EventSky}\n\t */\n\tallOff (event) {\n\t\tdelete this.events[event]\n\n\t\tthis._firehose(`.off.all(\"${event}\") removed all event handlers`)\n\n\t\tthis.events[event] = this._utils.createNewEventMap()\n\n\t\treturn this\n\t}\n\n\ttrigger (event, data) {\n\t\tif (!this._utils.validateEventName(this, event)) return this\n\n\t\tif (!this.events[event]) {\n\t\t\tthis._firehose(`\"${event}\" triggered with no handlers setup`)\n\n\t\t\treturn this\n\t\t}\n\n\t\tthis._firehose(`\"${event}\" triggered`)\n\n\t\t// beforeAll\n\t\tconst beforeAll = this.events[event].beforeAll\n\n\t\tObject.keys(beforeAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tbeforeAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!beforeAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// on\n\t\tconst on = this.events[event].on\n\n\t\tObject.keys(on).forEach(key => {\n\t\t\ttry {\n\t\t\t\ton[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!on[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// once\n\t\tconst once = this.events[event].once\n\n\t\tObject.keys(once).forEach(key => {\n\t\t\ttry {\n\t\t\t\tonce[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!once[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// afterAll\n\t\tconst afterAll = this.events[event].afterAll\n\n\t\tObject.keys(afterAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tafterAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!afterAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn this\n\t}\n}\n\nexport default new EventSky()\n"],"names":["it","undefined","TypeError","Object","defined","hasOwnProperty","key","call","toString","slice","propertyIsEnumerable","cof","split","IObject","ceil","Math","floor","isNaN","min","toInteger","max","index","length","global","module","window","self","Function","__g","store","id","px","random","concat","shared","arrayIndexOf","IS_INCLUDES","$this","el","fromIndex","value","O","toIObject","toLength","toIndex","IE_PROTO","uid","object","names","i","result","has","push","keys","$keys","enumBugKeys","core","version","__e","fn","that","aFunction","a","b","c","apply","arguments","isObject","exec","e","require$$0","defineProperty","get","document","is","createElement","require$$1","require$$2","S","val","valueOf","dP","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","enumerable","configurable","writable","f","createDesc","$export","type","name","source","own","out","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","IS_WRAP","W","exports","expProto","target","ctx","C","this","virtual","R","hide","U","KEY","exp","fails","toObject","default","__esModule","instance","Constructor","$Object","desc","_defineProperty2","obj","_defineProperty","defineProperties","props","descriptor","protoProps","staticProps","prototype","eventName","when","event","handler","warn","_this","events","_utils","createNewEventMap","config","ignoreDuplicateHandler","handlers","_handlerCount","_handlers","eventId","context","error","console","utils","_firehose","firehose","log","msg","on","curryWhenHandler","bind","once","beforeAll","afterAll","off","all","allOff","eventOrId","forEach","_this2","_eventName","includes","_eventWhen","eventNameAndHandlerMatch","_eventId","eventIdMatch","data","validateEventName"],"mappings":"oSACA,MAAiB,SAASA,GACxB,OAASC,IAAND,EAAgB,KAAME,WAAU,yBAA2BF,EAC9D,OAAOA,MCDQ,SAASA,GACxB,MAAOG,QAAOC,EAAQJ,KCHpBK,KAAoBA,iBACP,SAASL,EAAIM,GAC5B,MAAOD,GAAeE,KAAKP,EAAIM,ICF7BE,KAAcA,WAED,SAASR,GACxB,MAAOQ,GAASD,KAAKP,GAAIS,MAAM,GAAI,MCDpBN,OAAO,KAAKO,qBAAqB,GAAKP,OAAS,SAASH,GACvE,MAAkB,UAAXW,EAAIX,GAAkBA,EAAGY,MAAM,IAAMT,OAAOH,MCApC,SAASA,GACxB,MAAOa,GAAQT,EAAQJ,KCHrBc,EAAQC,KAAKD,KACbE,EAAQD,KAAKC,QACA,SAAShB,GACxB,MAAOiB,OAAMjB,GAAMA,GAAM,GAAKA,EAAK,EAAIgB,EAAQF,GAAMd,ICHnDkB,EACYH,KAAKG,MACJ,SAASlB,GACxB,MAAOA,GAAK,EAAIkB,EAAIC,EAAUnB,GAAK,kBAAoB,GCJrDoB,EACYL,KAAKK,IACjBF,EAAYH,KAAKG,MACJ,SAASG,EAAOC,GAE/B,MADAD,GAAQF,EAAUE,GACXA,EAAQ,EAAID,EAAIC,EAAQC,EAAQ,GAAKJ,EAAIG,EAAOC,oBCJzD,GAAIC,GAASC,UAAkC,mBAAVC,SAAyBA,OAAOV,MAAQA,KACzEU,OAAwB,mBAARC,OAAuBA,KAAKX,MAAQA,KAAOW,KAAOC,SAAS,gBAC9D,iBAAPC,OAAgBA,IAAML,KCD5BM,EAASN,EADA,wBACmBA,EADnB,0BCDTO,EAAK,EACLC,EAAKhB,KAAKiB,WACG,SAAS1B,GACxB,MAAO,UAAU2B,WAAehC,KAARK,EAAoB,GAAKA,EAAK,QAASwB,EAAKC,GAAIvB,SAAS,MCH/E0B,EFGa,SAAS5B,GACxB,MAAO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AIU,QAAQ,kBAEnBrK,GAAK6K,GACP,MAAO9G,GACH4F,EAAG3J,WAGCoJ,8BAA8Bd,SAAWqB,EAAG3J,GAAKyF,MAAS,2CAA4C2D,MAAOrF,EAAG8G,KAAMA,YAFtHzB,8BAA8Bd,oCAAyCY,QAASlJ,EAAK6K,KAAMA,UAQhGf,GAAOlD,KAAK8B,OAAOJ,GAAOwB,OAEpBA,GAAMO,QAAQ,kBAEnBrK,GAAK6K,GACT,MAAO9G,GACH+F,EAAK9J,WAGDoJ,gCAAgCd,SAAWqB,EAAG3J,GAAKyF,MAAS,2CAA4C2D,MAAOrF,EAAG8G,KAAMA,YAFxHzB,gCAAgCd,oCAAyCY,QAASlJ,EAAK6K,KAAMA,UAQlGb,GAAWpD,KAAK8B,OAAOJ,GAAO0B,kBAExBA,GAAUK,QAAQ,kBAEnBrK,GAAK6K,GACb,MAAO9G,GACHiG,EAAShK,WAGLoJ,oCAAoCd,SAAWqB,EAAG3J,GAAKyF,MAAS,2CAA4C2D,MAAOrF,EAAG8G,KAAMA,YAF5HzB,oCAAoCd,oCAAyCY,QAASlJ,EAAK6K,KAAMA,OAOrGjE"} \ No newline at end of file +{"version":3,"file":"build.js","sources":["node_modules/core-js/library/modules/_defined.js","node_modules/core-js/library/modules/_to-object.js","node_modules/core-js/library/modules/_has.js","node_modules/core-js/library/modules/_cof.js","node_modules/core-js/library/modules/_iobject.js","node_modules/core-js/library/modules/_to-iobject.js","node_modules/core-js/library/modules/_to-integer.js","node_modules/core-js/library/modules/_to-length.js","node_modules/core-js/library/modules/_to-index.js","node_modules/core-js/library/modules/_global.js","node_modules/core-js/library/modules/_shared.js","node_modules/core-js/library/modules/_uid.js","node_modules/core-js/library/modules/_shared-key.js","node_modules/core-js/library/modules/_object-keys-internal.js","node_modules/core-js/library/modules/_array-includes.js","node_modules/core-js/library/modules/_enum-bug-keys.js","node_modules/core-js/library/modules/_object-keys.js","node_modules/core-js/library/modules/_core.js","node_modules/core-js/library/modules/_a-function.js","node_modules/core-js/library/modules/_ctx.js","node_modules/core-js/library/modules/_is-object.js","node_modules/core-js/library/modules/_an-object.js","node_modules/core-js/library/modules/_fails.js","node_modules/core-js/library/modules/_descriptors.js","node_modules/core-js/library/modules/_dom-create.js","node_modules/core-js/library/modules/_ie8-dom-define.js","node_modules/core-js/library/modules/_to-primitive.js","node_modules/core-js/library/modules/_object-dp.js","node_modules/core-js/library/modules/_property-desc.js","node_modules/core-js/library/modules/_hide.js","node_modules/core-js/library/modules/_export.js","node_modules/core-js/library/modules/_object-sap.js","node_modules/core-js/library/modules/es6.object.keys.js","node_modules/core-js/library/fn/object/keys.js","node_modules/babel-runtime/core-js/object/keys.js","node_modules/babel-runtime/helpers/classCallCheck.js","node_modules/core-js/library/modules/es6.object.define-property.js","node_modules/core-js/library/fn/object/define-property.js","node_modules/babel-runtime/core-js/object/define-property.js","node_modules/babel-runtime/helpers/createClass.js","src/utils.js","src/main.js"],"sourcesContent":["// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var global = require('./_global')\n , core = require('./_core')\n , ctx = require('./_ctx')\n , hide = require('./_hide')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , IS_WRAP = type & $export.W\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE]\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]\n , key, own, out;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if(own && key in exports)continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function(C){\n var F = function(a, b, c){\n if(this instanceof C){\n switch(arguments.length){\n case 0: return new C;\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if(IS_PROTO){\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f});","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc){\n return $Object.defineProperty(it, key, desc);\n};","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();","// utility methods for EventSky\n\nexport default {\n\t/**\n\t * This provides a format for event map objects\n\t * @returns {{}}\n\t */\n\tcreateNewEventMap (eventName) {\n\t\treturn {\n\t\t\t// aggregate number of handlers for this event\n\t\t\thandlers: 0,\n\t\t\t_handlers: 0,\n\t\t\t_name: eventName,\n\t\t\ton: {},\n\t\t\tonce: {},\n\t\t\tbeforeAll: {},\n\t\t\tafterAll: {},\n\t\t}\n\t},\n\n\t/**\n\t * Utility used to setup 'when' handlers on parent class\n\t * @param when {string} 'on', 'beforeAll', etc.\n\t * @return function\n\t */\n\tcurryWhenHandler (when) {\n\t\treturn (event, handler) => {\n\t\t\t// verify params\n\t\t\tif (typeof event !== 'string' || event.length < 1 || typeof handler !== 'function') {\n\t\t\t\tconsole.warn(`EventSky warning: \"${event}\" event must be a string and handler must be a function - not set with .${when} handler`)\n\n\t\t\t\treturn this\n\t\t\t}\n\n\t\t\t// ensure the event exists and is setup on the event store\n\t\t\tif (!this.events[event]) {\n\t\t\t\tthis.events[event] = this._utils.createNewEventMap(event)\n\t\t\t}\n\n\t\t\t// check if the event and handler are a duplicate\n\t\t\tif (this.events[event][when] && this.events[event][when] === handler) {\n\t\t\t\tif (!this.config.ignoreDuplicateHandler) {\n\t\t\t\t\tconsole.warn(`EventSky warning: duplicate handler for .${when}('${event}')`)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.events[event].handlers++\n\t\t\tconst _handlerCount = this.events[event]._handlers++\n\t\t\tconst eventId = `id_${event}.${when}.${_handlerCount}`\n\t\t\tthis.events[event][when][eventId] = handler\n\n\t\t\treturn eventId\n\t\t}\n\t},\n\n\tvalidateEventName (context, eventName) {\n\t\tif (!context) {\n\t\t\treturn console.error('EventSky._utils needs to be passed a valid context param')\n\t\t} else if (!eventName || typeof eventName !== 'string') {\n\t\t\tconsole.error('EventSky error: .trigger(event) did not receive a string param')\n\n\t\t\treturn false\n\t\t}\n\n\t\treturn true\n\t},\n}\n","import utils from './utils'\n\nclass EventSky {\n\tconstructor () {\n\t\tthis.config = {\n\t\t\tfirehose: false,\n\t\t\tignoreDuplicateHandler: false, // warns about duplicate event/handler\n\t\t}\n\n\t\tthis._utils = utils\n\n\t\t// map of events\n\t\tthis.events = {}\n\t\tthis._firehose = msg => this.config.firehose ? console.log(`EventSky Firehose >> ${msg}`) : null\n\n\t\t// setup 'when' event handlers\n\t\tthis.on = this._utils.curryWhenHandler.bind(this)('on')\n\t\tthis.once = this._utils.curryWhenHandler.bind(this)('once')\n\t\tthis.beforeAll = this._utils.curryWhenHandler.bind(this)('beforeAll')\n\t\tthis.afterAll = this._utils.curryWhenHandler.bind(this)('afterAll')\n\n\t\t// extend a chain call for eventSky.off.all()\n\t\tthis.off.all = this.allOff.bind(this)\n\t}\n\n\t/**\n\t * Remove a handler for an event, the first parameter can be and event name\n\t * or an eventId to be removed.\n\t * @param eventOrId\n\t * @param handler\n\t * @returns {EventSky}\n\t */\n\toff = (eventOrId, handler) => {\n\t\t// iterate all events by names\n\t\tObject.keys(this.events).forEach(_eventName => {\n\t\t\t// iterate each 'when' event lifecycle and look for eventId or handler to remove\n\t\t\tObject.keys(this.events[_eventName]).forEach(_eventWhen => {\n\t\t\t\tif (!['beforeAll', 'on', 'once', 'afterAll'].includes(_eventWhen)) return\n\n\t\t\t\t// iterate each event of the current 'when' for event\n\t\t\t\tObject.keys(this.events[_eventName][_eventWhen]).forEach(_eventId => {\n\t\t\t\t\tconst eventNameAndHandlerMatch = (\n\t\t\t\t\t\t\tthis.events[_eventName][_eventWhen][_eventId] === handler &&\n\t\t\t\t\t\t\t_eventName === eventOrId\n\t\t\t\t\t\t)\n\t\t\t\t\tconst eventIdMatch = (!handler && _eventId === eventOrId)\n\n\t\t\t\t\tconst performDelete = (\n\t\t\t\t\t\t\teventNameAndHandlerMatch ||\n\t\t\t\t\t\t\teventIdMatch\n\t\t\t\t\t\t)\n\n\t\t\t\t\tif (performDelete) {\n\t\t\t\t\t\tdelete this.events[_eventName][_eventWhen][_eventId]\n\t\t\t\t\t\tthis.events[_eventName].handlers--\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Turn off all handlers for an event name\n\t * @param eventName {string} the name of the event\n\t * @returns {EventSky}\n\t */\n\tallOff (event) {\n\t\tdelete this.events[event]\n\n\t\tthis._firehose(`.off.all(\"${event}\") removed all event handlers`)\n\n\t\tthis.events[event] = this._utils.createNewEventMap()\n\n\t\treturn this\n\t}\n\n\ttrigger (event, data) {\n\t\tif (!this._utils.validateEventName(this, event)) return this\n\n\t\tif (!this.events[event]) {\n\t\t\tthis._firehose(`\"${event}\" triggered with no handlers setup`)\n\n\t\t\treturn this\n\t\t}\n\n\t\tthis._firehose(`\"${event}\" triggered`)\n\n\t\t// beforeAll\n\t\tconst beforeAll = this.events[event].beforeAll\n\n\t\tObject.keys(beforeAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tbeforeAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!beforeAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// on\n\t\tconst on = this.events[event].on\n\n\t\tObject.keys(on).forEach(key => {\n\t\t\ttry {\n\t\t\t\ton[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!on[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// once\n\t\tconst once = this.events[event].once\n\n\t\tObject.keys(once).forEach(key => {\n\t\t\ttry {\n\t\t\t\tonce[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!once[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// afterAll\n\t\tconst afterAll = this.events[event].afterAll\n\n\t\tObject.keys(afterAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tafterAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!afterAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn this\n\t}\n}\n\nexport default new EventSky()\n"],"names":["it","undefined","TypeError","Object","defined","hasOwnProperty","key","call","toString","slice","propertyIsEnumerable","cof","split","IObject","ceil","Math","floor","isNaN","min","toInteger","max","index","length","global","module","window","self","Function","__g","store","id","px","random","concat","shared","arrayIndexOf","IS_INCLUDES","$this","el","fromIndex","value","O","toIObject","toLength","toIndex","IE_PROTO","uid","object","names","i","result","has","push","keys","$keys","enumBugKeys","core","version","__e","fn","that","aFunction","a","b","c","apply","arguments","isObject","exec","e","require$$0","defineProperty","get","document","is","createElement","require$$1","require$$2","S","val","valueOf","dP","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","enumerable","configurable","writable","f","createDesc","$export","type","name","source","own","out","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","IS_WRAP","W","exports","expProto","target","ctx","C","this","virtual","R","hide","U","KEY","exp","fails","toObject","default","__esModule","instance","Constructor","$Object","desc","_defineProperty2","obj","_defineProperty","defineProperties","props","descriptor","protoProps","staticProps","prototype","eventName","when","event","handler","warn","_this","events","_utils","createNewEventMap","config","ignoreDuplicateHandler","handlers","_handlerCount","_handlers","eventId","context","error","console","off","eventOrId","forEach","_eventName","includes","_eventWhen","eventNameAndHandlerMatch","_eventId","eventIdMatch","utils","_firehose","firehose","log","msg","on","curryWhenHandler","bind","once","beforeAll","afterAll","all","allOff","data","validateEventName"],"mappings":"oSACA,MAAiB,SAASA,GACxB,OAASC,IAAND,EAAgB,KAAME,WAAU,yB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,KAAMA,YAFtHxB,8BAA8Bd,oCAAyCY,QAASlJ,EAAK4K,KAAMA,UAQhGL,GAAO3D,KAAK8B,OAAOJ,GAAOiC,OAEpBA,GAAMf,QAAQ,kBAEnBxJ,GAAK4K,GACT,MAAO7G,GACHwG,EAAKvK,WAGDoJ,gCAAgCd,SAAW8B,EAAGpK,GAAKyF,MAAS,2CAA4C2D,MAAOrF,EAAG6G,KAAMA,YAFxHxB,gCAAgCd,oCAAyCY,QAASlJ,EAAK4K,KAAMA,UAQlGH,GAAW7D,KAAK8B,OAAOJ,GAAOmC,kBAExBA,GAAUjB,QAAQ,kBAEnBxJ,GAAK4K,GACb,MAAO7G,GACH0G,EAASzK,WAGLoJ,oCAAoCd,SAAW8B,EAAGpK,GAAKyF,MAAS,2CAA4C2D,MAAOrF,EAAG6G,KAAMA,YAF5HxB,oCAAoCd,oCAAyCY,QAASlJ,EAAK4K,KAAMA,OAOrGhE"} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 0beec35..3f37b7d 100644 --- a/src/main.js +++ b/src/main.js @@ -30,7 +30,7 @@ class EventSky { * @param handler * @returns {EventSky} */ - off (eventOrId, handler) { + off = (eventOrId, handler) => { // iterate all events by names Object.keys(this.events).forEach(_eventName => { // iterate each 'when' event lifecycle and look for eventId or handler to remove @@ -66,7 +66,7 @@ class EventSky { * @param eventName {string} the name of the event * @returns {EventSky} */ - allOff (event) { + allOff = (event) => { delete this.events[event] this._firehose(`.off.all("${event}") removed all event handlers`) @@ -76,7 +76,7 @@ class EventSky { return this } - trigger (event, data) { + trigger = (event, data) => { if (!this._utils.validateEventName(this, event)) return this if (!this.events[event]) { From 30f1a125392bb9ca1482c89003bf6adb6e3d6c8a Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Tue, 25 Apr 2017 16:07:46 -0700 Subject: [PATCH 08/11] fix(): tests --- src/main.js | 10 +++++++--- .babelrc => test/.babelrc | 0 2 files changed, 7 insertions(+), 3 deletions(-) rename .babelrc => test/.babelrc (100%) diff --git a/src/main.js b/src/main.js index 3f37b7d..b420ed7 100644 --- a/src/main.js +++ b/src/main.js @@ -19,6 +19,10 @@ class EventSky { this.beforeAll = this._utils.curryWhenHandler.bind(this)('beforeAll') this.afterAll = this._utils.curryWhenHandler.bind(this)('afterAll') + // bind methods + this.off = this.off.bind(this) + this.trigger = this.trigger.bind(this) + // extend a chain call for eventSky.off.all() this.off.all = this.allOff.bind(this) } @@ -30,7 +34,7 @@ class EventSky { * @param handler * @returns {EventSky} */ - off = (eventOrId, handler) => { + off (eventOrId, handler) { // iterate all events by names Object.keys(this.events).forEach(_eventName => { // iterate each 'when' event lifecycle and look for eventId or handler to remove @@ -66,7 +70,7 @@ class EventSky { * @param eventName {string} the name of the event * @returns {EventSky} */ - allOff = (event) => { + allOff (event) { delete this.events[event] this._firehose(`.off.all("${event}") removed all event handlers`) @@ -76,7 +80,7 @@ class EventSky { return this } - trigger = (event, data) => { + trigger (event, data) { if (!this._utils.validateEventName(this, event)) return this if (!this.events[event]) { diff --git a/.babelrc b/test/.babelrc similarity index 100% rename from .babelrc rename to test/.babelrc From ad722c478c25e14d0aea7a2ac2fe12e2e089fed6 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Thu, 8 Jun 2017 12:53:58 -0700 Subject: [PATCH 09/11] fix(): npm distro with a .npmignore file BREAKING CHANGE: no longer distributed to npm with a source map build --- .npmignore | 46 ++++++++++++++++++++++++++++++++++++ mixin.js | 68 ------------------------------------------------------ 2 files changed, 46 insertions(+), 68 deletions(-) create mode 100644 .npmignore delete mode 100644 mixin.js diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..e598b9a --- /dev/null +++ b/.npmignore @@ -0,0 +1,46 @@ +coverage/ +dev/ +node_modules/ +src/ +test/ + +.eslintrc +.travis.yml +rollup.config.js +yarn.lock + +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules + +coverage/ +doc/ +bower_components/ + +*.iml +.idea/ + +*.png +CONTRIBUTING.md +favicon.ico +circle.yml +bower.json +.bowerrc +Gruntfile.js +*.start.js +karma.conf.js +junit/ +test/ +lib/ +src/ \ No newline at end of file diff --git a/mixin.js b/mixin.js deleted file mode 100644 index 697f2ae..0000000 --- a/mixin.js +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************** - * This is event-sky built as a React mixin * * - * * - * Description * - * We first check if the window object is * - * available and has our event module * - * iniitialized, if it's not then we * - * iniitializ or then check GLOBAL because * - * we might be on server/node or other env * - * * - ***********************************************/ - - -// Exposed methods -// var API = { -// init : init, -// // subscribe to an event -// on : on, -// // subscribe to be triggered before other -// before : before, -// // subscribe to be triggered after other -// after : after, -// // will only listen and fire once to an event -// once : once, -// // unsubscribe to an event -// off : off, -// // trigger an event -// trigger : trigger, -// // list of events -// events : getEventList, -// // dev -// dev : { eventStack : eventStack, eventMap : eventStackIdMap } -// }; -// -// // expose to global scope -// GLOBAL_SCOPE === 'window' ? window[namespace] = API : global[namespace] = API; - - - - -var namespace; - -// check if we're in a browser environment -if (typeof(window)!=='undefined') { - if (!window.eventSky) { - require('event-sky'); - if (!window.eventSky) { - throw new Error('eventSky is not initialized and cannot be found with "require(\'event-sky\')"'); - } - } - namespace = window.eventSky; -} -// assume we're serverSide, phonegap or other environment -else { - // id server side (node), GLOBAL/global will be available - // if it's not, we instantiate a GLOBAL - var GLOBAL = GLOBAL || global || {}; - - if (!GLOBAL.eventSky) { - require('event-sky'); - if (!GLOBAL.eventSky) { - throw new Error('eventSky is not initialized and cannot be found with "require(\'event-sky\')"'); - } - } - namespace = GLOBAL.eventSky; -} - -module.exports = namespace; From eab714908e9221af614a48c45b15c07592d56264 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Thu, 8 Jun 2017 12:55:53 -0700 Subject: [PATCH 10/11] fix(): rollup config sourceMaps --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 3d2ae86..32870b4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -19,5 +19,5 @@ export default { uglify(), ], dest: 'build.js', - sourceMap: true, + sourceMap: false, } From 2ece951bb3ce2aaf4d83d6d77da9ebc40b5484c8 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Thu, 8 Jun 2017 13:24:31 -0700 Subject: [PATCH 11/11] doc(): changelog for major rel --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f43350..f7b3f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.0.0 - 7JUN17 - coryrobinson42@gmail.com +- breaking change - no longer shipping npm build with sourcemaps due to +and issue with IE11 and production bundles consuming this package from +node_modules that has a .js.map file attached to it + ## 1.0.0 - 27APR17 - coryrobinson42@gmail.com - complete rewrite over lib