@@ -29,21 +29,6 @@ Dispatches a message to all registered Stores. This process is done synchronousl
29
29
reactor .dispatch (' addUser' , { name: ' jordan' })
30
30
```
31
31
32
- #### ` Reactor#batch(fn) `
33
-
34
- _ added in 1.1_
35
-
36
- Allows multiple dispatches within the ` fn ` function before notifying any observers.
37
-
38
- ``` javascript
39
- reactor .batch (function () {
40
- reactor .dispatch (' addUser' , { name: ' jordan' })
41
- reactor .dispatch (' addUser' , { name: ' james' })
42
- })
43
-
44
- // does a single notify to all observers
45
- ```
46
-
47
32
#### ` Reactor#evaluate(Getter | KeyPath) `
48
33
49
34
Returns the immutable value for some KeyPath or Getter in the reactor state. Returns ` undefined ` if a keyPath doesn't have a value.
@@ -85,6 +70,41 @@ reactor.observe([
85
70
])
86
71
` ` `
87
72
73
+ #### ` Reactor#batch (fn)`
74
+
75
+ _added in 1.1_
76
+
77
+ Allows multiple dispatches within the ` fn` function before notifying any observers.
78
+
79
+ ` ` ` javascript
80
+ reactor .batch (function () {
81
+ reactor .dispatch (' addUser' , { name: ' jordan' })
82
+ reactor .dispatch (' addUser' , { name: ' james' })
83
+ })
84
+
85
+ // does a single notify to all observers
86
+ ` ` `
87
+
88
+ #### ` Reactor#batchStart ()`
89
+
90
+ _added in 1.2_
91
+
92
+ Sets the reactor in batch mode, where dispatches don't cause observer notification until ` batchEnd ()` is called.
93
+
94
+ ` ` ` javascript
95
+ // the following is equivalent to the `reactor.batch` example
96
+ reactor .batchStart ()
97
+ reactor .dispatch (' addUser' , { name: ' jordan' })
98
+ reactor .dispatch (' addUser' , { name: ' james' })
99
+ reactor .batchEnd ()
100
+ ` ` `
101
+
102
+ #### ` Reactor#batchEnd ()`
103
+
104
+ _added in 1.2_
105
+
106
+ Signifies the end of reactor batching and will notify all observers of the changes that happened since ` batchStart`
107
+
88
108
#### ` Reactor#serialize ()`
89
109
90
110
_added in 1.1_
0 commit comments