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
- Resolves Issue #54
- This enables snapshotting a subset of the app data
- `takeSnapshot` returns stringified JSON containing just the subset
of data specified. The new snapshot is merged with the LAST_SNAPSHOT data
to ensure that the last snapshot of the stores not specified in the subset
is not lost. This also means that rollbacks will just work.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -529,12 +529,12 @@ Restart the loop by making your views kick off new actions.
529
529
530
530
### Snapshots
531
531
532
-
`takeSnapshot :: String`
532
+
`takeSnapshot :: ?...String -> String`
533
533
534
534
Snapshots are a core component of alt. The idea is that at any given point in time you can `takeSnapshot` and have your entire application's state
535
535
serialized for persistence, transferring, logging, or debugging.
536
536
537
-
Taking a snapshot is as easy as calling `alt.takeSnapshot()`.
537
+
Taking a snapshot is as easy as calling `alt.takeSnapshot()`. It can also take an optional number of arguments as strings which correspond to the store names you would like to include in the snapshot. This allows you to take a snapshot of a subset of your app's data.
Copy file name to clipboardExpand all lines: docs/takeSnapshot.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,14 @@ permalink: /docs/takeSnapshot/
7
7
8
8
# takeSnapshot
9
9
10
-
> (): string
10
+
> (...storeNames: ?string): string
11
11
12
-
Take snapshot provides you with the entire application's state serialized to JSON.
12
+
Take snapshot provides you with the entire application's state serialized to JSON, by default, but you may also pass in store names to take a snapshot of a subset of the application's state.
13
13
14
14
Snapshots are a core component of alt. The idea is that at any given point in time you can `takeSnapshot` and have your entire application's state
15
-
serialized for persistence, transfering, logging, or debugging.
15
+
serialized for persistence, transferring, logging, or debugging.
16
16
17
17
```js
18
18
var snapshot =alt.takeSnapshot();
19
+
var partialSnapshot =alt.takeSnapshot('Store1', 'Store3');
0 commit comments