瀏覽代碼

mention that mutations must be sync

Evan You 9 年之前
父節點
當前提交
a2236014a5
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/counter/vuex.js

+ 2 - 1
examples/counter/vuex.js

@@ -48,7 +48,8 @@ const actions = {
 // mutations are operations that actually mutates the state.
 // mutations are operations that actually mutates the state.
 // each mutation handler gets the entire state tree as the
 // each mutation handler gets the entire state tree as the
 // first argument, followed by additional payload arguments.
 // first argument, followed by additional payload arguments.
-// mutations can be recorded by middlewares.
+// mutations must be synchronous and can be recorded by middlewares
+// for debugging purposes.
 const mutations = {
 const mutations = {
   [INCREMENT] (state) {
   [INCREMENT] (state) {
     state.count++
     state.count++