You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,21 @@
27
27
28
28
## Daux.Core.Batch
29
29
30
+
Batch is used for performing multiple state operations in one go. This means that the subscription callbacks will only get triggered once when batching operations.
31
+
32
+
```javascript
33
+
import { Store } from'daux';
34
+
35
+
importUserfrom'./models/user';
36
+
37
+
conststore=newStore({ user: User });
38
+
constbatch=store.batch();
39
+
40
+
batch.set('user', { id:'user_a', name:'User A' });
41
+
batch.set('user', { id:'user_b', name:'User B' });
42
+
batch.commit();
43
+
```
44
+
30
45
### Functions
31
46
32
47
#### commit
@@ -79,6 +94,8 @@ Batch an update operation
79
94
80
95
## Daux.Core.Model
81
96
97
+
The model is a blueprint on how Daux will represent the your app's underlying data.
98
+
82
99
### Static Properties
83
100
84
101
#### attributes
@@ -140,6 +157,11 @@ Type: Object
140
157
141
158
## Daux.Core.Store
142
159
160
+
The store is used for:
161
+
162
+
- Holding your app's states as well as doing CRUD operations against them
163
+
- Register listeners that gets fired whenever a state changes
0 commit comments