persisters
The persisters
module of the TinyBase project provides a simple framework for saving and loading Store
data, to and from different destinations, or underlying storage types.
Several entry points are provided (in separately installed modules), each of which returns a new Persister
object that can load and save a Store
. Between them, these allow you to store your TinyBase data locally, remotely, to SQLite databases, and across synchronization boundaries with CRDT frameworks.
Module | Function | Storage |
---|---|---|
persister-browser | createSessionPersister | Browser session storage |
persister-browser | createLocalPersister | Browser local storage |
persister-indexed-db | createIndexedDbPersister | Browser IndexedDB |
persister-remote | createRemotePersister | Remote server |
persister-file | createFilePersister | Local file (where possible) |
persister-sqlite3 | createSqlite3Persister | SQLite in Node, via sqlite3 |
persister-sqlite-wasm | createSqliteWasmPersister | SQLite in a browser, via sqlite-wasm |
persister-cr-sqlite-wasm | createCrSqliteWasmPersister | SQLite CRDTs, via cr-sqlite-wasm |
persister-expo-sqlite | createExpoSqlitePersister | SQLite in React Native, via expo-sqlite |
persister-yjs | createYjsPersister | Yjs CRDTs, via yjs |
persister-automerge | createSqliteWasmPersister | Automerge CRDTs, via automerge-repo |
Since persistence requirements can be different for every app, the createCustomPersister
function in this module can also be used to easily create a fully customized way to save and load Store
data.
See also
Persisting Data guide
Database Persistence guide
Synchronizing Data guide
Countries demo
Todo App demos
Drawing demo
Interfaces
There is one interface, Persister
, within the persisters
module.
Functions
There is one function, createCustomPersister
, within the persisters
module.
Type Aliases
These are the type aliases within the persisters
module.