|
@@ -1,6 +1,6 @@
|
|
|
/**
|
|
|
- * vuex v3.1.2
|
|
|
- * (c) 2019 Evan You
|
|
|
+ * vuex v3.1.3
|
|
|
+ * (c) 2020 Evan You
|
|
|
* @license MIT
|
|
|
*/
|
|
|
function applyMixin (Vue) {
|
|
@@ -392,7 +392,10 @@ Store.prototype.commit = function commit (_type, _payload, _options) {
|
|
|
handler(payload);
|
|
|
});
|
|
|
});
|
|
|
- this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
|
|
|
+
|
|
|
+ this._subscribers
|
|
|
+ .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
|
|
|
+ .forEach(function (sub) { return sub(mutation, this$1.state); });
|
|
|
|
|
|
if (
|
|
|
process.env.NODE_ENV !== 'production' &&
|
|
@@ -424,6 +427,7 @@ Store.prototype.dispatch = function dispatch (_type, _payload) {
|
|
|
|
|
|
try {
|
|
|
this._actionSubscribers
|
|
|
+ .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
|
|
|
.filter(function (sub) { return sub.before; })
|
|
|
.forEach(function (sub) { return sub.before(action, this$1.state); });
|
|
|
} catch (e) {
|
|
@@ -792,9 +796,7 @@ function enableStrictMode (store) {
|
|
|
}
|
|
|
|
|
|
function getNestedState (state, path) {
|
|
|
- return path.length
|
|
|
- ? path.reduce(function (state, key) { return state[key]; }, state)
|
|
|
- : state
|
|
|
+ return path.reduce(function (state, key) { return state[key]; }, state)
|
|
|
}
|
|
|
|
|
|
function unifyObjectStyle (type, payload, options) {
|
|
@@ -1037,7 +1039,7 @@ function getModuleByNamespace (store, helper, namespace) {
|
|
|
var index_esm = {
|
|
|
Store: Store,
|
|
|
install: install,
|
|
|
- version: '3.1.2',
|
|
|
+ version: '3.1.3',
|
|
|
mapState: mapState,
|
|
|
mapMutations: mapMutations,
|
|
|
mapGetters: mapGetters,
|