TinyBase logoTinyBase

getDocHandle

The getDocHandle method returns the Automerge document handler the Store is being persisted to.

getDocHandle(): DocHandle<any>
returnsDocHandle<any>

The Automerge document handler.

Example

This example creates a Persister object against a newly-created Store and then gets the Automerge document handler back out again.

const docHandler = new AutomergeRepo.Repo({network: []}).create();
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createAutomergePersister(store, docHandler);

console.log(persister.getDocHandle() == docHandler);
// -> true

persister.destroy();

Since

v4.3.14