We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a961b2 commit 335e608Copy full SHA for 335e608
src/persisters/common.ts
@@ -20,8 +20,8 @@ export const createCustomPersister = (
20
21
const persister: Persister = {
22
load: async (
23
- initialTables?: Tables,
24
- initialValues?: Values,
+ initialTables: Tables = {},
+ initialValues: Values = {},
25
): Promise<Persister> => {
26
/*! istanbul ignore else */
27
if (loadSave != 2) {
@@ -34,9 +34,7 @@ export const createCustomPersister = (
34
store.setJson(body);
35
} else {
36
store.transaction(() =>
37
- store
38
- .setTables(initialTables as Tables)
39
- .setValues(initialValues as Values),
+ store.setTables(initialTables).setValues(initialValues),
40
);
41
}
42
loadSave = 0;
@@ -45,8 +43,8 @@ export const createCustomPersister = (
45
43
},
46
44
47
startAutoLoad: async (
48
49
50
51
persister.stopAutoLoad();
52
await persister.load(initialTables, initialValues);
0 commit comments