Skip to content

Commit 9ac9eae

Browse files
authored
Update API.md
1 parent 68808d8 commit 9ac9eae

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

API.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@
2727

2828
## Daux.Core.Batch
2929

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+
import User from './models/user';
36+
37+
const store = new Store({ user: User });
38+
const batch = 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+
3045
### Functions
3146

3247
#### commit
@@ -79,6 +94,8 @@ Batch an update operation
7994

8095
## Daux.Core.Model
8196

97+
The model is a blueprint on how Daux will represent the your app's underlying data.
98+
8299
### Static Properties
83100

84101
#### attributes
@@ -140,6 +157,11 @@ Type: Object
140157

141158
## Daux.Core.Store
142159

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
164+
143165
### Functions
144166

145167
#### batch

0 commit comments

Comments
 (0)