data-chamber
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.DataChamber=e():t.DataChamber=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=0)}([function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,i,o=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);u=!0);}catch(t){a=!0,i=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}r.r(e),r.d(e,"Store",(function(){return c}));var o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(t).reduce((function(t,e){var r=n(e,2),i=(r[0],r[1]),o=i.actions,u=void 0===o?{}:o,a=i.name,s=i.state,c=void 0===s?null:s;return t[a]={actions:u,state:c},t}),{})};function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,i,o=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);u=!0);}catch(t){a=!0,i=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var c=function(){function t(e){var r=e.name,n=void 0===r?"":r,i=e.services,u=void 0===i?{}:i,a=e.types,s=void 0===a?{}:a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.lastUid=0,this.name=n,this.services=u,this.subscribers={},this.types=o(s),this._typeConfigs=s}var e,r,n;return e=t,(r=[{key:"dispatch",value:function(t,e){var r=u(this._tokenizeAction(t),2),n=r[0],i=r[1],o=this.types[n],a=o.actions[i];return this._setState({state:a({prevState:o.state,services:this.services},e),typeName:n}),this.types[n].state}},{key:"getState",value:function(t){return t?this.types[t].state:Object.entries(this.types).reduce((function(t,e){var r=u(e,2),n=r[0],i=r[1].state;return t[n]=i,t}),{})}},{key:"reset",value:function(){this.lastUid=0,this.subscribers={},this.types=o(this._typeConfigs)}},{key:"subscribe",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r="uid_".concat(++this.lastUid);return this.subscribers[r]=e,e(this,{typeName:null}),{onNotify:e,token:r,unsubscribe:function(){return t._unsubscribe(r)}}}},{key:"_notify",value:function(t){var e=this;Object.values(this.subscribers).forEach((function(r){return r(e,{typeName:t})}))}},{key:"_setState",value:function(t){var e=t.state,r=t.typeName;return this.types[r].state=e,this._notify(r)}},{key:"_tokenizeAction",value:function(t){var e=u(t.split("."),1)[0];return[e,t.slice(e.length+1)]}},{key:"_unsubscribe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;delete this.subscribers[t]}}])&&s(e.prototype,r),n&&s(e,n),t}()}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.DataChamber=e():t.DataChamber=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=0)}([function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,i,o=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);u=!0);}catch(t){a=!0,i=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}r.r(e),r.d(e,"Store",(function(){return c}));var o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(t).reduce((function(t,e){var r=n(e,2),i=(r[0],r[1]),o=i.actions,u=void 0===o?{}:o,a=i.name,s=i.state,c=void 0===s?null:s;return t[a]={actions:u,state:c},t}),{})};function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,i,o=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);u=!0);}catch(t){a=!0,i=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var c=function(){function t(e){var r=e.name,n=void 0===r?"":r,i=e.services,u=void 0===i?{}:i,a=e.types,s=void 0===a?{}:a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.lastUid=0,this.name=n,this.services=u,this.subscribers={},this.types=o(s),this._typeConfigs=s}var e,r,n;return e=t,(r=[{key:"dispatch",value:function(t,e){var r=u(this._tokenizeAction(t),2),n=r[0],i=r[1],o=this.types[n],a=o.actions[i];return this._setState({state:a({prevState:o.state,services:this.services},e),typeName:n}),this.types[n].state}},{key:"getState",value:function(t){return t?this.types[t].state:Object.entries(this.types).reduce((function(t,e){var r=u(e,2),n=r[0],i=r[1].state;return t[n]=i,t}),{})}},{key:"reset",value:function(){this.types=o(this._typeConfigs),this._notifyAllOnReset()}},{key:"subscribe",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},r="uid_".concat(++this.lastUid);return this.subscribers[r]=e,e(this,{typeName:null}),{onNotify:e,token:r,unsubscribe:function(){return t._unsubscribe(r)}}}},{key:"_notify",value:function(t){var e=this;Object.values(this.subscribers).forEach((function(r){return r(e,{typeName:t})}))}},{key:"_notifyAllOnReset",value:function(){var t=this;Object.keys(this.types).forEach((function(e){return t._notify(e)}))}},{key:"_setState",value:function(t){var e=t.state,r=t.typeName;return this.types[r].state=e,this._notify(r)}},{key:"_tokenizeAction",value:function(t){var e=u(t.split("."),1)[0];return[e,t.slice(e.length+1)]}},{key:"_unsubscribe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;delete this.subscribers[t]}}])&&s(e.prototype,r),n&&s(e,n),t}()}])})); |
{ | ||
"name": "data-chamber", | ||
"author": "Scotty Rogers", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
7197