Quellcode durchsuchen

Mini fix in rootState example. (#629)

* Mini fix in rootState example.

Maybe I misunderstood the example, but without parenthesis the `%` operator will be executed before the `+`.

* Update modules.md
Agustin Arias vor 8 Jahren
Ursprung
Commit
bb083ce432
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      docs/en/modules.md

+ 1 - 1
docs/en/modules.md

@@ -58,7 +58,7 @@ const moduleA = {
   // ...
   actions: {
     incrementIfOddOnRootSum ({ state, commit, rootState }) {
-      if (state.count + rootState.count % 2 === 1) {
+      if ((state.count + rootState.count) % 2 === 1) {
         commit('increment')
       }
     }