Skip to content

Commit

Permalink
[build] 0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 8, 2016
1 parent d5fdaea commit 4db6b75
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
40 changes: 33 additions & 7 deletions dist/vuex.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Vuex v0.6.1
* Vuex v0.6.2
* (c) 2016 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -40,6 +40,16 @@
};
}();

babelHelpers.toConsumableArray = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

return arr2;
} else {
return Array.from(arr);
}
};

babelHelpers;

/**
Expand Down Expand Up @@ -298,6 +308,9 @@
// use a Vue instance to store the state tree
// suppress warnings just in case the user has added
// some funky global mixins
if (!Vue) {
throw new Error('[vuex] must call Vue.use(Vuex) before creating a store instance.');
}
var silent = Vue.config.silent;
Vue.config.silent = true;
this._vm = new Vue({
Expand Down Expand Up @@ -337,6 +350,11 @@
payload[_key2 - 1] = arguments[_key2];
}

// compatibility for object actions, e.g. FSA
if ((typeof type === 'undefined' ? 'undefined' : babelHelpers.typeof(type)) === 'object' && type.type && arguments.length === 1) {
payload = [type];
type = type.type;
}
var mutation = this._mutations[type];
var prevSnapshot = this._prevSnapshot;
var state = this.state;
Expand All @@ -347,10 +365,10 @@
// apply the mutation
if (Array.isArray(mutation)) {
mutation.forEach(function (m) {
return m.apply(undefined, [state].concat(payload));
return m.apply(undefined, [state].concat(babelHelpers.toConsumableArray(payload)));
});
} else {
mutation.apply(undefined, [state].concat(payload));
mutation.apply(undefined, [state].concat(babelHelpers.toConsumableArray(payload)));
}
this._dispatching = false;
// invoke middlewares
Expand Down Expand Up @@ -393,7 +411,7 @@
}

/**
* Hot update actions and mutations.
* Hot update mutations & modules.
*
* @param {Object} options
* - {Object} [mutations]
Expand Down Expand Up @@ -433,16 +451,19 @@
* Bind mutations for each module to its sub tree and
* merge them all into one final mutations map.
*
* @param {Object} modules
* @param {Object} updatedModules
*/

}, {
key: '_setupModuleMutations',
value: function _setupModuleMutations(modules) {
this._modules = modules;
value: function _setupModuleMutations(updatedModules) {
var modules = this._modules;
var getPath = Vue.parsers.path.getPath;

var allMutations = [this._rootMutations];
Object.keys(updatedModules).forEach(function (key) {
modules[key] = updatedModules[key];
});
Object.keys(modules).forEach(function (key) {
var module = modules[key];
if (!module || !module.mutations) return;
Expand Down Expand Up @@ -535,6 +556,11 @@
override(Vue);
}

// auto install in dist mode
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}

function createLogger() {
console.warn('[vuex] Vuex.createLogger has been deprecated.' + 'Use `import createLogger from \'vuex/logger\' instead.');
}
Expand Down
4 changes: 2 additions & 2 deletions dist/vuex.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4db6b75

Please sign in to comment.