TinyBase logoTinyBase

hasStoreInStorage

The hasStoreInStorage function returns a boolean indicating whether durable PartyKit storage contains a serialized Store.

hasStoreInStorage(
  storage: Storage,
  storagePrefix?: string,
): Promise<boolean>
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<boolean>

A promised boolean indicating whether a Store is present in the storage.

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