isAutoSaving
The isAutoSaving
method lets you find out if the Persister
is currently automatically saving its content.
isAutoSaving(): boolean
returns | boolean | A boolean indicating whether the |
---|
Example
This example creates a Persister
and queries whether it is autoSaving.
import {createSessionPersister} from 'tinybase/persisters/persister-browser';
import {createStore} from 'tinybase';
const persister = createSessionPersister(createStore(), 'pets');
console.log(persister.isAutoSaving());
// -> false
await persister.startAutoSave();
console.log(persister.isAutoSaving());
// -> true
await persister.stopAutoSave();
console.log(persister.isAutoSaving());
// -> false
Since
v5.0.0