TinyBase logoTinyBase

loadStoreFromStorage

The loadStoreFromStorage function returns the content of a Store from durable PartyKit storage.

loadStoreFromStorage(
  storage: Storage,
  storagePrefix?: string,
): Promise<Content>
TypeDescription
storageStorage

A reference to the storage object, as would normally be accessible from the [TinyBasePartyKitServer](/api/persister-partykit-server/classes/server/tinybasepartykitserver/).party object.

storagePrefix?string

An optional prefix used before all the keys in the server's durable storage, to match the equivalent property in the server's TinyBasePartyKitServerConfig.

returnsPromise<Content>

A promised array of a Tables object and a Values object.

This is intended for specialist applications that require the ability to inspect or load a TinyBase Store from a server's storage outside of the normal context of a TinyBasePartyKitServer.

The function is asynchronous, so you should use the await keyword or handle the result as a promise.

Since

v4.4.1