TinyBase logoTinyBase β

getTinyJoin

The getTinyJoin method returns a reference to the TinyJoin client the Store is being persisted to.

getTinyJoin(): Client
returnsClient

A reference to the TinyJoin client.

Example

This example creates a Persister object against a newly-created Store and then gets the TinyJoin client back out again.

import {createStore} from 'tinybase';
import {createTinyJoinPersister} from 'tinybase/persisters/persister-tinyjoin';
import {create} from 'tinyjoin';

const tinyJoin = await create();
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createTinyJoinPersister(store, tinyJoin, 'my_tinybase');

console.log(persister.getTinyJoin() == tinyJoin);
// -> true

await persister.destroy();
await tinyJoin.close();

Since

10.0.0