Skip to content

Commit 8398be0

Browse files
committed
[persisters] Default autoLoadIntervalSeconds
1 parent 98ae615 commit 8398be0

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/persisters/persister-indexed-db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const execObjectStore = async (
4646
export const createIndexedDbPersister = ((
4747
store: Store,
4848
dbName: string,
49-
autoLoadIntervalSeconds: number,
49+
autoLoadIntervalSeconds = 1,
5050
onIgnoredError?: (error: any) => void,
5151
): Persister => {
5252
const forObjectStores = async (

src/persisters/persister-remote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const createRemotePersister = ((
1111
store: Store,
1212
loadUrl: string,
1313
saveUrl: string,
14-
autoLoadIntervalSeconds: number,
14+
autoLoadIntervalSeconds = 5,
1515
onIgnoredError?: (error: any) => void,
1616
): Persister => {
1717
let lastEtag: string | null;

src/types/docs/persisters/persister-indexed-db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @param store The Store to persist.
2828
* @param dbName The unique key to identify the IndexedDB to use.
2929
* @param autoLoadIntervalSeconds How often to poll the database when in
30-
* 'autoLoad' mode.
30+
* 'autoLoad' mode, defaulting to 1.
3131
* @param onIgnoredError An optional handler for the errors that the Persister
3232
* would otherwise ignore when trying to save or load data. This is suitable for
3333
* debugging persistence issues in a development environment.

src/types/docs/persisters/persister-remote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @param loadUrl The endpoint that supports a `GET` method to load JSON.
2323
* @param saveUrl The endpoint that supports a `POST` method to save JSON.
2424
* @param autoLoadIntervalSeconds How often to poll the `loadUrl` when
25-
* automatically loading changes from the server.
25+
* automatically loading changes from the server, defaulting to 5.
2626
* @param onIgnoredError An optional handler for the errors that the Persister
2727
* would otherwise ignore when trying to save or load data. This is suitable for
2828
* debugging persistence issues in a development environment, since v4.0.4.

src/types/persisters/persister-indexed-db.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import {Store} from '../store';
77
export function createIndexedDbPersister(
88
store: Store,
99
dbName: string,
10-
autoLoadIntervalSeconds: number,
10+
autoLoadIntervalSeconds?: number,
1111
onIgnoredError?: (error: any) => void,
1212
): Persister;

src/types/persisters/persister-remote.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export function createRemotePersister(
88
store: Store,
99
loadUrl: string,
1010
saveUrl: string,
11-
autoLoadIntervalSeconds: number,
11+
autoLoadIntervalSeconds?: number,
1212
onIgnoredError?: (error: any) => void,
1313
): Persister;

src/types/with-schemas/persisters/persister-indexed-db.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import {Persister} from '../persisters';
77
export function createIndexedDbPersister<Schemas extends OptionalSchemas>(
88
store: Store<Schemas>,
99
dbName: string,
10-
autoLoadIntervalSeconds: number,
10+
autoLoadIntervalSeconds?: number,
1111
onIgnoredError?: (error: any) => void,
1212
): Persister<Schemas>;

src/types/with-schemas/persisters/persister-remote.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export function createRemotePersister<Schemas extends OptionalSchemas>(
88
store: Store<Schemas>,
99
loadUrl: string,
1010
saveUrl: string,
11-
autoLoadIntervalSeconds: number,
11+
autoLoadIntervalSeconds?: number,
1212
onIgnoredError?: (error: any) => void,
1313
): Persister<Schemas>;

0 commit comments

Comments
 (0)