Comparing version 3.0.0 to 3.1.0
# Changelog | ||
### 3.1.0 | ||
* `Dispatcher`: Methods `register` and `unregister` can once again be called in | ||
the middle of a dispatch. | ||
### 3.0.0 | ||
@@ -4,0 +9,0 @@ |
/** | ||
* Flux v3.0.0 | ||
* Flux v3.1.0 | ||
*/ | ||
@@ -209,3 +209,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
Dispatcher.prototype.register = function register(callback) { | ||
!!this._isDispatching ? true ? invariant(false, 'Dispatcher.register(...): Cannot register in the middle of a dispatch.') : invariant(false) : undefined; | ||
var id = _prefix + this._lastID++; | ||
@@ -221,3 +220,2 @@ this._callbacks[id] = callback; | ||
Dispatcher.prototype.unregister = function unregister(id) { | ||
!!this._isDispatching ? true ? invariant(false, 'Dispatcher.unregister(...): Cannot unregister in the middle of a dispatch.') : invariant(false) : undefined; | ||
!this._callbacks[id] ? true ? invariant(false, 'Dispatcher.unregister(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined; | ||
@@ -224,0 +222,0 @@ delete this._callbacks[id]; |
/** | ||
* Flux v3.0.0 | ||
* Flux v3.1.0 | ||
* | ||
@@ -10,2 +10,2 @@ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
*/ | ||
!function(i,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Flux=t():i.Flux=t()}(this,function(){return function(i){function t(s){if(n[s])return n[s].exports;var e=n[s]={exports:{},id:s,loaded:!1};return i[s].call(e.exports,e,e.exports,t),e.loaded=!0,e.exports}var n={};return t.m=i,t.c=n,t.p="",t(0)}([function(i,t,n){"use strict";i.exports.Dispatcher=n(1)},function(i,t,n){"use strict";function s(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var e,o,a;t.__esModule=!0,e=n(2),o="ID_",a=function(){function i(){s(this,i),this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}return i.prototype.register=function(i){this._isDispatching?e(!1):void 0;var t=o+this._lastID++;return this._callbacks[t]=i,t},i.prototype.unregister=function(i){this._isDispatching?e(!1):void 0,this._callbacks[i]?void 0:e(!1),delete this._callbacks[i]},i.prototype.waitFor=function(i){var t,n;for(this._isDispatching?void 0:e(!1),t=0;t<i.length;t++)n=i[t],this._isPending[n]?this._isHandled[n]?void 0:e(!1):(this._callbacks[n]?void 0:e(!1),this._invokeCallback(n))},i.prototype.dispatch=function(i){this._isDispatching?e(!1):void 0,this._startDispatching(i);try{for(var t in this._callbacks)this._isPending[t]||this._invokeCallback(t)}finally{this._stopDispatching()}},i.prototype.isDispatching=function(){return this._isDispatching},i.prototype._invokeCallback=function(i){this._isPending[i]=!0,this._callbacks[i](this._pendingPayload),this._isHandled[i]=!0},i.prototype._startDispatching=function(i){for(var t in this._callbacks)this._isPending[t]=!1,this._isHandled[t]=!1;this._pendingPayload=i,this._isDispatching=!0},i.prototype._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},i}(),i.exports=a},function(i,t,n){"use strict";function s(i,t,n,s,e,o,a,r){var c,p,h;if(!i)throw void 0===t?c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."):(p=[n,s,e,o,a,r],h=0,c=new Error(t.replace(/%s/g,function(){return p[h++]})),c.name="Invariant Violation"),c.framesToPop=1,c}i.exports=s}])}); | ||
!function(i,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Flux=t():i.Flux=t()}(this,function(){return function(i){function t(s){if(n[s])return n[s].exports;var e=n[s]={exports:{},id:s,loaded:!1};return i[s].call(e.exports,e,e.exports,t),e.loaded=!0,e.exports}var n={};return t.m=i,t.c=n,t.p="",t(0)}([function(i,t,n){"use strict";i.exports.Dispatcher=n(1)},function(i,t,n){"use strict";function s(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var e,o,a;t.__esModule=!0,e=n(2),o="ID_",a=function(){function i(){s(this,i),this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}return i.prototype.register=function(i){var t=o+this._lastID++;return this._callbacks[t]=i,t},i.prototype.unregister=function(i){this._callbacks[i]?void 0:e(!1),delete this._callbacks[i]},i.prototype.waitFor=function(i){var t,n;for(this._isDispatching?void 0:e(!1),t=0;t<i.length;t++)n=i[t],this._isPending[n]?this._isHandled[n]?void 0:e(!1):(this._callbacks[n]?void 0:e(!1),this._invokeCallback(n))},i.prototype.dispatch=function(i){this._isDispatching?e(!1):void 0,this._startDispatching(i);try{for(var t in this._callbacks)this._isPending[t]||this._invokeCallback(t)}finally{this._stopDispatching()}},i.prototype.isDispatching=function(){return this._isDispatching},i.prototype._invokeCallback=function(i){this._isPending[i]=!0,this._callbacks[i](this._pendingPayload),this._isHandled[i]=!0},i.prototype._startDispatching=function(i){for(var t in this._callbacks)this._isPending[t]=!1,this._isHandled[t]=!1;this._pendingPayload=i,this._isDispatching=!0},i.prototype._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},i}(),i.exports=a},function(i,t,n){"use strict";function s(i,t,n,s,e,o,a,r){var c,p,l;if(!i)throw void 0===t?c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."):(p=[n,s,e,o,a,r],l=0,c=new Error(t.replace(/%s/g,function(){return p[l++]})),c.name="Invariant Violation"),c.framesToPop=1,c}i.exports=s}])}); |
/** | ||
* Flux v3.0.0 | ||
* Flux v3.1.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
@@ -129,3 +129,2 @@ /** | ||
Dispatcher.prototype.register = function register(callback) { | ||
!!this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.register(...): Cannot register in the middle of a dispatch.') : invariant(false) : undefined; | ||
var id = _prefix + this._lastID++; | ||
@@ -141,3 +140,2 @@ this._callbacks[id] = callback; | ||
Dispatcher.prototype.unregister = function unregister(id) { | ||
!!this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.unregister(...): Cannot unregister in the middle of a dispatch.') : invariant(false) : undefined; | ||
!this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.unregister(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined; | ||
@@ -144,0 +142,0 @@ delete this._callbacks[id]; |
{ | ||
"name": "flux", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "An application architecture based on a unidirectional data flow", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
18
0
307040
6108