TinyBase logoTinyBase

isAutoSaving

The isAutoSaving method lets you find out if the Persister is currently automatically saving its content.

isAutoSaving(): boolean
returnsboolean

A boolean indicating whether the Persister is currently autoSaving.

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