Comparing version 3.6.7 to 3.6.8
@@ -61,9 +61,9 @@ var Flummox = | ||
var _flux = __webpack_require__(4); | ||
var _flux = __webpack_require__(3); | ||
var _eventemitter = __webpack_require__(5); | ||
var _eventemitter = __webpack_require__(4); | ||
var _eventemitter2 = _interopRequireDefault(_eventemitter); | ||
var _objectAssign = __webpack_require__(3); | ||
var _objectAssign = __webpack_require__(5); | ||
@@ -397,7 +397,7 @@ var _objectAssign2 = _interopRequireDefault(_objectAssign); | ||
var _eventemitter = __webpack_require__(5); | ||
var _eventemitter = __webpack_require__(4); | ||
var _eventemitter2 = _interopRequireDefault(_eventemitter); | ||
var _objectAssign = __webpack_require__(3); | ||
var _objectAssign = __webpack_require__(5); | ||
@@ -632,3 +632,3 @@ var _objectAssign2 = _interopRequireDefault(_objectAssign); | ||
var _uniqueid = __webpack_require__(6); | ||
var _uniqueid = __webpack_require__(7); | ||
@@ -760,47 +760,2 @@ var _uniqueid2 = _interopRequireDefault(_uniqueid); | ||
/* eslint-disable no-unused-vars */ | ||
'use strict'; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
function toObject(val) { | ||
if (val === null || val === undefined) { | ||
throw new TypeError('Object.assign cannot be called with null or undefined'); | ||
} | ||
return Object(val); | ||
} | ||
module.exports = Object.assign || function (target, source) { | ||
var from; | ||
var to = toObject(target); | ||
var symbols; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
to[key] = from[key]; | ||
} | ||
} | ||
if (Object.getOwnPropertySymbols) { | ||
symbols = Object.getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
if (propIsEnumerable.call(from, symbols[i])) { | ||
to[symbols[i]] = from[symbols[i]]; | ||
} | ||
} | ||
} | ||
} | ||
return to; | ||
}; | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/** | ||
@@ -815,7 +770,7 @@ * Copyright (c) 2014-2015, Facebook, Inc. | ||
module.exports.Dispatcher = __webpack_require__(7) | ||
module.exports.Dispatcher = __webpack_require__(6) | ||
/***/ }, | ||
/* 5 */ | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1055,62 +1010,48 @@ | ||
/***/ }, | ||
/* 6 */ | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/* eslint-disable no-unused-vars */ | ||
'use strict'; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
function toObject(val) { | ||
if (val === null || val === undefined) { | ||
throw new TypeError('Object.assign cannot be called with null or undefined'); | ||
} | ||
var count = 0; | ||
return Object(val); | ||
} | ||
/** | ||
* Generate a unique ID. | ||
* | ||
* Optionally pass a prefix to prepend, a suffix to append, or a | ||
* multiplier to use on the ID. | ||
* | ||
* ```js | ||
* uniqueId(); //=> '25' | ||
* | ||
* uniqueId({prefix: 'apple_'}); | ||
* //=> 'apple_10' | ||
* | ||
* uniqueId({suffix: '_orange'}); | ||
* //=> '10_orange' | ||
* | ||
* uniqueId({multiplier: 5}); | ||
* //=> 5, 10, 15, 20... | ||
* ``` | ||
* | ||
* To reset the `id` to zero, do `id.reset()`. | ||
* | ||
* @param {Object} `options` Optionally pass a `prefix`, `suffix` and/or `multiplier. | ||
* @return {String} The unique id. | ||
* @api public | ||
*/ | ||
module.exports = Object.assign || function (target, source) { | ||
var from; | ||
var to = toObject(target); | ||
var symbols; | ||
var id = module.exports = function (options) { | ||
options = options || {}; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
var prefix = options.prefix; | ||
var suffix = options.suffix; | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
to[key] = from[key]; | ||
} | ||
} | ||
var id = ++count * (options.multiplier || 1); | ||
if (Object.getOwnPropertySymbols) { | ||
symbols = Object.getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
if (propIsEnumerable.call(from, symbols[i])) { | ||
to[symbols[i]] = from[symbols[i]]; | ||
} | ||
} | ||
} | ||
} | ||
if (prefix == null) { | ||
prefix = ''; | ||
} | ||
if (suffix == null) { | ||
suffix = ''; | ||
} | ||
return String(prefix) + id + String(suffix); | ||
return to; | ||
}; | ||
id.reset = function() { | ||
return count = 0; | ||
}; | ||
/***/ }, | ||
/* 7 */ | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1371,2 +1312,61 @@ | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var count = 0; | ||
/** | ||
* Generate a unique ID. | ||
* | ||
* Optionally pass a prefix to prepend, a suffix to append, or a | ||
* multiplier to use on the ID. | ||
* | ||
* ```js | ||
* uniqueId(); //=> '25' | ||
* | ||
* uniqueId({prefix: 'apple_'}); | ||
* //=> 'apple_10' | ||
* | ||
* uniqueId({suffix: '_orange'}); | ||
* //=> '10_orange' | ||
* | ||
* uniqueId({multiplier: 5}); | ||
* //=> 5, 10, 15, 20... | ||
* ``` | ||
* | ||
* To reset the `id` to zero, do `id.reset()`. | ||
* | ||
* @param {Object} `options` Optionally pass a `prefix`, `suffix` and/or `multiplier. | ||
* @return {String} The unique id. | ||
* @api public | ||
*/ | ||
var id = module.exports = function (options) { | ||
options = options || {}; | ||
var prefix = options.prefix; | ||
var suffix = options.suffix; | ||
var id = ++count * (options.multiplier || 1); | ||
if (prefix == null) { | ||
prefix = ''; | ||
} | ||
if (suffix == null) { | ||
suffix = ''; | ||
} | ||
return String(prefix) + id + String(suffix); | ||
}; | ||
id.reset = function() { | ||
return count = 0; | ||
}; | ||
/***/ }, | ||
/* 8 */ | ||
@@ -1373,0 +1373,0 @@ /***/ function(module, exports, __webpack_require__) { |
@@ -1,1 +0,1 @@ | ||
var Flummox=function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){return t.prototype.constructor.name}function c(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e}e.__esModule=!0,e.Actions=e.Store=e.Flummox=e.Flux=void 0;var h=n(1),p=i(h),u=n(2),f=i(u),l=n(3),d=n(4),y=i(d),_=n(5),v=i(_),g=function(t){function e(){s(this,e);var n=r(this,t.call(this));return n.dispatcher=new l.Dispatcher,n._stores={},n._actions={},n}return o(e,t),e.prototype.createStore=function(t,e){if(!(e.prototype instanceof p["default"])){var n=a(e);throw new Error("You've attempted to create a store from the class "+n+", which does not have the base Store class in its prototype chain. Make sure "+("you're using the `extends` keyword: `class "+n+" extends ")+"Store { ... }`")}if(this._stores.hasOwnProperty(t)&&this._stores[t])throw new Error("You've attempted to create multiple stores with key "+t+". Keys must be unique.");for(var i=arguments.length,s=Array(i>2?i-2:0),r=2;i>r;r++)s[r-2]=arguments[r];var o=new(Function.prototype.bind.apply(e,[null].concat(s))),c=this.dispatcher.register(o.handler.bind(o));return o._waitFor=this.waitFor.bind(this),o._token=c,o._getAllActionIds=this.getAllActionIds.bind(this),this._stores[t]=o,o},e.prototype.getStore=function(t){return this._stores.hasOwnProperty(t)?this._stores[t]:void 0},e.prototype.removeStore=function(t){if(!this._stores.hasOwnProperty(t))throw new Error("You've attempted to remove store with key "+t+" which does not exist.");this._stores[t].removeAllListeners(),this.dispatcher.unregister(this._stores[t]._token),delete this._stores[t]},e.prototype.createActions=function(t,e){if(!(e.prototype instanceof f["default"])&&e!==f["default"]){if("function"==typeof e){var n=a(e);throw new Error("You've attempted to create actions from the class "+n+", which does not have the base Actions class in its prototype chain. Make "+("sure you're using the `extends` keyword: `class "+n+" ")+"extends Actions { ... }`")}var i=e;e=function(t){function e(){return s(this,e),r(this,t.apply(this,arguments))}return o(e,t),e}(f["default"]),v["default"](e.prototype,i)}if(this._actions.hasOwnProperty(t)&&this._actions[t])throw new Error("You've attempted to create multiple actions with key "+t+". Keys must be unique.");for(var c=arguments.length,h=Array(c>2?c-2:0),p=2;c>p;p++)h[p-2]=arguments[p];var u=new(Function.prototype.bind.apply(e,[null].concat(h)));return u.dispatch=this.dispatch.bind(this),u.dispatchAsync=this.dispatchAsync.bind(this),this._actions[t]=u,u},e.prototype.getActions=function(t){return this._actions.hasOwnProperty(t)?this._actions[t]:void 0},e.prototype.getActionIds=function(t){var e=this.getActions(t);if(e)return e.getConstants()},e.prototype.removeActions=function(t){if(!this._actions.hasOwnProperty(t))throw new Error("You've attempted to remove actions with key "+t+" which does not exist.");delete this._actions[t]},e.prototype.getAllActionIds=function(){var t=[];for(var e in this._actions)if(this._actions.hasOwnProperty(e)){var n=this._actions[e].getConstants();t=t.concat(c(n))}return t},e.prototype.dispatch=function(t,e){this._dispatch({actionId:t,body:e})},e.prototype.dispatchAsync=function(t,e,n){var i=this,s={actionId:t,async:"begin"};return n&&(s.actionArgs=n),this._dispatch(s),e.then(function(e){return i._dispatch({actionId:t,body:e,async:"success"}),e},function(e){i._dispatch({actionId:t,error:e,async:"failure"})})["catch"](function(t){throw i.emit("error",t),t})},e.prototype._dispatch=function(t){this.dispatcher.dispatch(t),this.emit("dispatch",t)},e.prototype.waitFor=function(t){Array.isArray(t)||(t=[t]);var e=function(t){return t instanceof p["default"]?t._token:t},n=t.map(e);this.dispatcher.waitFor(n)},e.prototype.removeAllStoreListeners=function(t){for(var e in this._stores)if(this._stores.hasOwnProperty(e)){var n=this._stores[e];n.removeAllListeners(t)}},e.prototype.serialize=function(){var t={};for(var e in this._stores)if(this._stores.hasOwnProperty(e)){var n=this._stores[e],i=n.constructor.serialize;if("function"==typeof i){var s=i(n.state);if("string"!=typeof s){n.constructor.name}if(t[e]=s,"function"!=typeof n.constructor.deserialize){n.constructor.name}}}return JSON.stringify(t)},e.prototype.deserialize=function(t){var e=void 0;try{e=JSON.parse(t)}catch(n){this.constructor.name}for(var i in this._stores)if(this._stores.hasOwnProperty(i)){var s=this._stores[i],r=s.constructor.deserialize;if("function"==typeof r){var o=e[i],a=r(o);if(s.replaceState(a),"function"!=typeof s.constructor.serialize){s.constructor.name}}}},e}(y["default"]);e["default"]=g,g.prototype.getConstants=g.prototype.getActionIds,g.prototype.getAllConstants=g.prototype.getAllActionIds,g.prototype.dehydrate=g.prototype.serialize,g.prototype.hydrate=g.prototype.deserialize;var m=g;e.Flux=g,e.Flummox=m,e.Store=p["default"],e.Actions=f["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){return"function"==typeof t?t._id:t}e.__esModule=!0;var c=n(4),h=i(c),p=n(5),u=i(p),f=function(t){function e(){s(this,e);var n=r(this,t.call(this));return n.state=null,n._handlers={},n._asyncHandlers={},n._catchAllHandlers=[],n._catchAllAsyncHandlers={begin:[],success:[],failure:[]},n}return o(e,t),e.prototype.setState=function(t){if("function"==typeof t){var e=this._isHandlingDispatch?this._pendingState:this.state;t=t(e)}this._isHandlingDispatch?(this._pendingState=this._assignState(this._pendingState,t),this._emitChangeAfterHandlingDispatch=!0):(this.state=this._assignState(this.state,t),this.emit("change"))},e.prototype.replaceState=function(t){this._isHandlingDispatch?(this._pendingState=this._assignState(void 0,t),this._emitChangeAfterHandlingDispatch=!0):(this.state=this._assignState(void 0,t),this.emit("change"))},e.prototype.getStateAsObject=function(){return this.state},e.assignState=function(t,e){return u["default"]({},t,e)},e.prototype._assignState=function(){return(this.constructor.assignState||e.assignState).apply(void 0,arguments)},e.prototype.forceUpdate=function(){this._isHandlingDispatch?this._emitChangeAfterHandlingDispatch=!0:this.emit("change")},e.prototype.register=function(t,e){t=a(t),"function"==typeof e&&(this._handlers[t]=e.bind(this))},e.prototype.registerAsync=function(t,e,n,i){t=a(t);var s=this._bindAsyncHandlers({begin:e,success:n,failure:i});this._asyncHandlers[t]=s},e.prototype.registerAll=function(t){"function"==typeof t&&this._catchAllHandlers.push(t.bind(this))},e.prototype.registerAllAsync=function(t,e,n){var i=this,s=this._bindAsyncHandlers({begin:t,success:e,failure:n});Object.keys(s).forEach(function(t){i._catchAllAsyncHandlers[t].push(s[t])})},e.prototype._bindAsyncHandlers=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];"function"==typeof n?t[e]=n.bind(this):delete t[e]}return t},e.prototype.waitFor=function(t){this._waitFor(t)},e.prototype.handler=function(t){var e=t.body,n=t.actionId,i=t.async,s=t.actionArgs,r=t.error,o=this._catchAllHandlers,a=this._handlers[n],c=this._catchAllAsyncHandlers[i],h=this._asyncHandlers[n]&&this._asyncHandlers[n][i];if(i){var p=c.concat([h]);switch(i){case"begin":return void this._performHandler(p,s);case"failure":return void this._performHandler(p,[r]);case"success":return void this._performHandler(c.concat([h||a].concat(h&&[]||o)),[e]);default:return}}this._performHandler(o.concat([a]),[e])},e.prototype._performHandler=function(t,e){this._isHandlingDispatch=!0,this._pendingState=this._assignState(void 0,this.state),this._emitChangeAfterHandlingDispatch=!1;try{this._performHandlers(t,e)}finally{this._emitChangeAfterHandlingDispatch&&(this.state=this._pendingState,this.emit("change")),this._isHandlingDispatch=!1,this._pendingState=void 0,this._emitChangeAfterHandlingDispatch=!1}},e.prototype._performHandlers=function(t,e){var n=this;t.forEach(function(t){return"function"==typeof t&&t.apply(n,e)})},e}(h["default"]);e["default"]=f},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){return t&&"function"==typeof t.then}e.__esModule=!0;var o=n(7),a=i(o),c=function(){function t(){s(this,t),this._baseId=a["default"]();for(var e=this._getActionMethodNames(),n=0;n<e.length;n++){var i=e[n];this._wrapAction(i)}this.getConstants=this.getActionIds}return t.prototype.getActionIds=function(){var t=this;return this._getActionMethodNames().reduce(function(e,n){return e[n]=t[n]._id,e},{})},t.prototype._getActionMethodNames=function(t){var e=this;return Object.getOwnPropertyNames(this.constructor.prototype).filter(function(t){return"constructor"!==t&&"function"==typeof e[t]})},t.prototype._wrapAction=function(t){var e=this,n=this[t],i=this._createActionId(t),s=function(){for(var s=arguments.length,o=Array(s),a=0;s>a;a++)o[a]=arguments[a];var c=n.apply(e,o);if(r(c)){var h=c;e._dispatchAsync(i,h,o,t)}else e._dispatch(i,c,o,t);return c};s._id=i,this[t]=s},t.prototype._createActionId=function(t){return this._baseId+"-"+t},t.prototype._dispatch=function(t,e,n,i){return"function"==typeof this.dispatch&&"undefined"!=typeof e&&this.dispatch(t,e,n),e},t.prototype._dispatchAsync=function(t,e,n,i){"function"==typeof this.dispatchAsync&&this.dispatchAsync(t,e,n)},t}();e["default"]=c},function(t,e,n){t.exports.Dispatcher=n(6)},function(t,e,n){"use strict";function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(){}s.prototype._events=void 0,s.prototype.listeners=function(t){if(!this._events||!this._events[t])return[];if(this._events[t].fn)return[this._events[t].fn];for(var e=0,n=this._events[t].length,i=new Array(n);n>e;e++)i[e]=this._events[t][e].fn;return i},s.prototype.emit=function(t,e,n,i,s,r){if(!this._events||!this._events[t])return!1;var o,a,c=this._events[t],h=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(t,c.fn,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,i),!0;case 5:return c.fn.call(c.context,e,n,i,s),!0;case 6:return c.fn.call(c.context,e,n,i,s,r),!0}for(a=1,o=new Array(h-1);h>a;a++)o[a-1]=arguments[a];c.fn.apply(c.context,o)}else{var p,u=c.length;for(a=0;u>a;a++)switch(c[a].once&&this.removeListener(t,c[a].fn,!0),h){case 1:c[a].fn.call(c[a].context);break;case 2:c[a].fn.call(c[a].context,e);break;case 3:c[a].fn.call(c[a].context,e,n);break;default:if(!o)for(p=1,o=new Array(h-1);h>p;p++)o[p-1]=arguments[p];c[a].fn.apply(c[a].context,o)}}return!0},s.prototype.on=function(t,e,n){var s=new i(e,n||this);return this._events||(this._events={}),this._events[t]?this._events[t].fn?this._events[t]=[this._events[t],s]:this._events[t].push(s):this._events[t]=s,this},s.prototype.once=function(t,e,n){var s=new i(e,n||this,!0);return this._events||(this._events={}),this._events[t]?this._events[t].fn?this._events[t]=[this._events[t],s]:this._events[t].push(s):this._events[t]=s,this},s.prototype.removeListener=function(t,e,n){if(!this._events||!this._events[t])return this;var i=this._events[t],s=[];if(e&&(i.fn&&(i.fn!==e||n&&!i.once)&&s.push(i),!i.fn))for(var r=0,o=i.length;o>r;r++)(i[r].fn!==e||n&&!i[r].once)&&s.push(i[r]);return s.length?this._events[t]=1===s.length?s[0]:s:delete this._events[t],this},s.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[t]:this._events={},this):this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.EventEmitter=s,s.EventEmitter2=s,s.EventEmitter3=s,t.exports=s},function(t,e,n){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var n,o,a=i(t),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var h in n)s.call(n,h)&&(a[h]=n[h]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(n);for(var p=0;p<o.length;p++)r.call(n,o[p])&&(a[o[p]]=n[o[p]])}}return a}},function(t,e,n){"use strict";function i(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var s=n(8),r=1,o="ID_";i.prototype.register=function(t){var e=o+r++;return this.$Dispatcher_callbacks[e]=t,e},i.prototype.unregister=function(t){s(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},i.prototype.waitFor=function(t){s(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?s(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(s(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},i.prototype.dispatch=function(t){s(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},i.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},i.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},i.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},i.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=i},function(t,e,n){"use strict";var i=0,s=t.exports=function(t){t=t||{};var e=t.prefix,n=t.suffix,s=++i*(t.multiplier||1);return null==e&&(e=""),null==n&&(n=""),String(e)+s+String(n)};s.reset=function(){return i=0}},function(t,e,n){"use strict";var i=function(t,e,n,i,s,r,o,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[n,i,s,r,o,a],p=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return h[p++]}))}throw c.framesToPop=1,c}};t.exports=i}]); | ||
var Flummox=function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){return t.prototype.constructor.name}function c(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e}e.__esModule=!0,e.Actions=e.Store=e.Flummox=e.Flux=void 0;var h=n(1),p=i(h),u=n(2),f=i(u),l=n(3),d=n(5),y=i(d),_=n(4),v=i(_),g=function(t){function e(){s(this,e);var n=r(this,t.call(this));return n.dispatcher=new l.Dispatcher,n._stores={},n._actions={},n}return o(e,t),e.prototype.createStore=function(t,e){if(!(e.prototype instanceof p["default"])){var n=a(e);throw new Error("You've attempted to create a store from the class "+n+", which does not have the base Store class in its prototype chain. Make sure "+("you're using the `extends` keyword: `class "+n+" extends ")+"Store { ... }`")}if(this._stores.hasOwnProperty(t)&&this._stores[t])throw new Error("You've attempted to create multiple stores with key "+t+". Keys must be unique.");for(var i=arguments.length,s=Array(i>2?i-2:0),r=2;i>r;r++)s[r-2]=arguments[r];var o=new(Function.prototype.bind.apply(e,[null].concat(s))),c=this.dispatcher.register(o.handler.bind(o));return o._waitFor=this.waitFor.bind(this),o._token=c,o._getAllActionIds=this.getAllActionIds.bind(this),this._stores[t]=o,o},e.prototype.getStore=function(t){return this._stores.hasOwnProperty(t)?this._stores[t]:void 0},e.prototype.removeStore=function(t){if(!this._stores.hasOwnProperty(t))throw new Error("You've attempted to remove store with key "+t+" which does not exist.");this._stores[t].removeAllListeners(),this.dispatcher.unregister(this._stores[t]._token),delete this._stores[t]},e.prototype.createActions=function(t,e){if(!(e.prototype instanceof f["default"])&&e!==f["default"]){if("function"==typeof e){var n=a(e);throw new Error("You've attempted to create actions from the class "+n+", which does not have the base Actions class in its prototype chain. Make "+("sure you're using the `extends` keyword: `class "+n+" ")+"extends Actions { ... }`")}var i=e;e=function(t){function e(){return s(this,e),r(this,t.apply(this,arguments))}return o(e,t),e}(f["default"]),v["default"](e.prototype,i)}if(this._actions.hasOwnProperty(t)&&this._actions[t])throw new Error("You've attempted to create multiple actions with key "+t+". Keys must be unique.");for(var c=arguments.length,h=Array(c>2?c-2:0),p=2;c>p;p++)h[p-2]=arguments[p];var u=new(Function.prototype.bind.apply(e,[null].concat(h)));return u.dispatch=this.dispatch.bind(this),u.dispatchAsync=this.dispatchAsync.bind(this),this._actions[t]=u,u},e.prototype.getActions=function(t){return this._actions.hasOwnProperty(t)?this._actions[t]:void 0},e.prototype.getActionIds=function(t){var e=this.getActions(t);if(e)return e.getConstants()},e.prototype.removeActions=function(t){if(!this._actions.hasOwnProperty(t))throw new Error("You've attempted to remove actions with key "+t+" which does not exist.");delete this._actions[t]},e.prototype.getAllActionIds=function(){var t=[];for(var e in this._actions)if(this._actions.hasOwnProperty(e)){var n=this._actions[e].getConstants();t=t.concat(c(n))}return t},e.prototype.dispatch=function(t,e){this._dispatch({actionId:t,body:e})},e.prototype.dispatchAsync=function(t,e,n){var i=this,s={actionId:t,async:"begin"};return n&&(s.actionArgs=n),this._dispatch(s),e.then(function(e){return i._dispatch({actionId:t,body:e,async:"success"}),e},function(e){i._dispatch({actionId:t,error:e,async:"failure"})})["catch"](function(t){throw i.emit("error",t),t})},e.prototype._dispatch=function(t){this.dispatcher.dispatch(t),this.emit("dispatch",t)},e.prototype.waitFor=function(t){Array.isArray(t)||(t=[t]);var e=function(t){return t instanceof p["default"]?t._token:t},n=t.map(e);this.dispatcher.waitFor(n)},e.prototype.removeAllStoreListeners=function(t){for(var e in this._stores)if(this._stores.hasOwnProperty(e)){var n=this._stores[e];n.removeAllListeners(t)}},e.prototype.serialize=function(){var t={};for(var e in this._stores)if(this._stores.hasOwnProperty(e)){var n=this._stores[e],i=n.constructor.serialize;if("function"==typeof i){var s=i(n.state);if("string"!=typeof s){n.constructor.name}if(t[e]=s,"function"!=typeof n.constructor.deserialize){n.constructor.name}}}return JSON.stringify(t)},e.prototype.deserialize=function(t){var e=void 0;try{e=JSON.parse(t)}catch(n){this.constructor.name}for(var i in this._stores)if(this._stores.hasOwnProperty(i)){var s=this._stores[i],r=s.constructor.deserialize;if("function"==typeof r){var o=e[i],a=r(o);if(s.replaceState(a),"function"!=typeof s.constructor.serialize){s.constructor.name}}}},e}(y["default"]);e["default"]=g,g.prototype.getConstants=g.prototype.getActionIds,g.prototype.getAllConstants=g.prototype.getAllActionIds,g.prototype.dehydrate=g.prototype.serialize,g.prototype.hydrate=g.prototype.deserialize;var m=g;e.Flux=g,e.Flummox=m,e.Store=p["default"],e.Actions=f["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){return"function"==typeof t?t._id:t}e.__esModule=!0;var c=n(5),h=i(c),p=n(4),u=i(p),f=function(t){function e(){s(this,e);var n=r(this,t.call(this));return n.state=null,n._handlers={},n._asyncHandlers={},n._catchAllHandlers=[],n._catchAllAsyncHandlers={begin:[],success:[],failure:[]},n}return o(e,t),e.prototype.setState=function(t){if("function"==typeof t){var e=this._isHandlingDispatch?this._pendingState:this.state;t=t(e)}this._isHandlingDispatch?(this._pendingState=this._assignState(this._pendingState,t),this._emitChangeAfterHandlingDispatch=!0):(this.state=this._assignState(this.state,t),this.emit("change"))},e.prototype.replaceState=function(t){this._isHandlingDispatch?(this._pendingState=this._assignState(void 0,t),this._emitChangeAfterHandlingDispatch=!0):(this.state=this._assignState(void 0,t),this.emit("change"))},e.prototype.getStateAsObject=function(){return this.state},e.assignState=function(t,e){return u["default"]({},t,e)},e.prototype._assignState=function(){return(this.constructor.assignState||e.assignState).apply(void 0,arguments)},e.prototype.forceUpdate=function(){this._isHandlingDispatch?this._emitChangeAfterHandlingDispatch=!0:this.emit("change")},e.prototype.register=function(t,e){t=a(t),"function"==typeof e&&(this._handlers[t]=e.bind(this))},e.prototype.registerAsync=function(t,e,n,i){t=a(t);var s=this._bindAsyncHandlers({begin:e,success:n,failure:i});this._asyncHandlers[t]=s},e.prototype.registerAll=function(t){"function"==typeof t&&this._catchAllHandlers.push(t.bind(this))},e.prototype.registerAllAsync=function(t,e,n){var i=this,s=this._bindAsyncHandlers({begin:t,success:e,failure:n});Object.keys(s).forEach(function(t){i._catchAllAsyncHandlers[t].push(s[t])})},e.prototype._bindAsyncHandlers=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];"function"==typeof n?t[e]=n.bind(this):delete t[e]}return t},e.prototype.waitFor=function(t){this._waitFor(t)},e.prototype.handler=function(t){var e=t.body,n=t.actionId,i=t.async,s=t.actionArgs,r=t.error,o=this._catchAllHandlers,a=this._handlers[n],c=this._catchAllAsyncHandlers[i],h=this._asyncHandlers[n]&&this._asyncHandlers[n][i];if(i){var p=c.concat([h]);switch(i){case"begin":return void this._performHandler(p,s);case"failure":return void this._performHandler(p,[r]);case"success":return void this._performHandler(c.concat([h||a].concat(h&&[]||o)),[e]);default:return}}this._performHandler(o.concat([a]),[e])},e.prototype._performHandler=function(t,e){this._isHandlingDispatch=!0,this._pendingState=this._assignState(void 0,this.state),this._emitChangeAfterHandlingDispatch=!1;try{this._performHandlers(t,e)}finally{this._emitChangeAfterHandlingDispatch&&(this.state=this._pendingState,this.emit("change")),this._isHandlingDispatch=!1,this._pendingState=void 0,this._emitChangeAfterHandlingDispatch=!1}},e.prototype._performHandlers=function(t,e){var n=this;t.forEach(function(t){return"function"==typeof t&&t.apply(n,e)})},e}(h["default"]);e["default"]=f},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){return t&&"function"==typeof t.then}e.__esModule=!0;var o=n(7),a=i(o),c=function(){function t(){s(this,t),this._baseId=a["default"]();for(var e=this._getActionMethodNames(),n=0;n<e.length;n++){var i=e[n];this._wrapAction(i)}this.getConstants=this.getActionIds}return t.prototype.getActionIds=function(){var t=this;return this._getActionMethodNames().reduce(function(e,n){return e[n]=t[n]._id,e},{})},t.prototype._getActionMethodNames=function(t){var e=this;return Object.getOwnPropertyNames(this.constructor.prototype).filter(function(t){return"constructor"!==t&&"function"==typeof e[t]})},t.prototype._wrapAction=function(t){var e=this,n=this[t],i=this._createActionId(t),s=function(){for(var s=arguments.length,o=Array(s),a=0;s>a;a++)o[a]=arguments[a];var c=n.apply(e,o);if(r(c)){var h=c;e._dispatchAsync(i,h,o,t)}else e._dispatch(i,c,o,t);return c};s._id=i,this[t]=s},t.prototype._createActionId=function(t){return this._baseId+"-"+t},t.prototype._dispatch=function(t,e,n,i){return"function"==typeof this.dispatch&&"undefined"!=typeof e&&this.dispatch(t,e,n),e},t.prototype._dispatchAsync=function(t,e,n,i){"function"==typeof this.dispatchAsync&&this.dispatchAsync(t,e,n)},t}();e["default"]=c},function(t,e,n){t.exports.Dispatcher=n(6)},function(t,e,n){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var n,o,a=i(t),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var h in n)s.call(n,h)&&(a[h]=n[h]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(n);for(var p=0;p<o.length;p++)r.call(n,o[p])&&(a[o[p]]=n[o[p]])}}return a}},function(t,e,n){"use strict";function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(){}s.prototype._events=void 0,s.prototype.listeners=function(t){if(!this._events||!this._events[t])return[];if(this._events[t].fn)return[this._events[t].fn];for(var e=0,n=this._events[t].length,i=new Array(n);n>e;e++)i[e]=this._events[t][e].fn;return i},s.prototype.emit=function(t,e,n,i,s,r){if(!this._events||!this._events[t])return!1;var o,a,c=this._events[t],h=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(t,c.fn,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,i),!0;case 5:return c.fn.call(c.context,e,n,i,s),!0;case 6:return c.fn.call(c.context,e,n,i,s,r),!0}for(a=1,o=new Array(h-1);h>a;a++)o[a-1]=arguments[a];c.fn.apply(c.context,o)}else{var p,u=c.length;for(a=0;u>a;a++)switch(c[a].once&&this.removeListener(t,c[a].fn,!0),h){case 1:c[a].fn.call(c[a].context);break;case 2:c[a].fn.call(c[a].context,e);break;case 3:c[a].fn.call(c[a].context,e,n);break;default:if(!o)for(p=1,o=new Array(h-1);h>p;p++)o[p-1]=arguments[p];c[a].fn.apply(c[a].context,o)}}return!0},s.prototype.on=function(t,e,n){var s=new i(e,n||this);return this._events||(this._events={}),this._events[t]?this._events[t].fn?this._events[t]=[this._events[t],s]:this._events[t].push(s):this._events[t]=s,this},s.prototype.once=function(t,e,n){var s=new i(e,n||this,!0);return this._events||(this._events={}),this._events[t]?this._events[t].fn?this._events[t]=[this._events[t],s]:this._events[t].push(s):this._events[t]=s,this},s.prototype.removeListener=function(t,e,n){if(!this._events||!this._events[t])return this;var i=this._events[t],s=[];if(e&&(i.fn&&(i.fn!==e||n&&!i.once)&&s.push(i),!i.fn))for(var r=0,o=i.length;o>r;r++)(i[r].fn!==e||n&&!i[r].once)&&s.push(i[r]);return s.length?this._events[t]=1===s.length?s[0]:s:delete this._events[t],this},s.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[t]:this._events={},this):this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.EventEmitter=s,s.EventEmitter2=s,s.EventEmitter3=s,t.exports=s},function(t,e,n){"use strict";function i(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var s=n(8),r=1,o="ID_";i.prototype.register=function(t){var e=o+r++;return this.$Dispatcher_callbacks[e]=t,e},i.prototype.unregister=function(t){s(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},i.prototype.waitFor=function(t){s(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?s(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(s(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},i.prototype.dispatch=function(t){s(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},i.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},i.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},i.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},i.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=i},function(t,e,n){"use strict";var i=0,s=t.exports=function(t){t=t||{};var e=t.prefix,n=t.suffix,s=++i*(t.multiplier||1);return null==e&&(e=""),null==n&&(n=""),String(e)+s+String(n)};s.reset=function(){return i=0}},function(t,e,n){"use strict";var i=function(t,e,n,i,s,r,o,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[n,i,s,r,o,a],p=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return h[p++]}))}throw c.framesToPop=1,c}};t.exports=i}]); |
{ | ||
"name": "flummox", | ||
"version": "3.6.7", | ||
"version": "3.6.8", | ||
"description": "Idiomatic, modular, testable, isomorphic Flux. No singletons required.", | ||
@@ -5,0 +5,0 @@ "main": "lib/Flux.js", |
Sorry, the diff of this file is not supported yet
228983
22
2053