Skip to content

CreateSyncStoragePersisterOptions

CreateSyncStoragePersisterOptions: object

Options for creating a sync storage persister.

Type declaration

deserialize()?

optional deserialize: (cachedString) => SerializableTevmState

How to deserialize the data from storage.

Parameters

cachedString: string

Returns

SerializableTevmState

Default

JSON.parse

key?

optional key: string

The key to use when storing the cache

serialize()?

optional serialize: (client) => string

How to serialize the data to storage.

Parameters

client: SerializableTevmState

Returns

string

Default

JSON.stringify

storage

storage: Storage

The storage client used for setting and retrieving items from cache. For SSR pass in undefined. Note that window.localStorage can be null in Android WebViews depending on how they are configured.

throttleTime?

optional throttleTime: number

To avoid spamming, pass a time in ms to throttle saving the cache to disk

Defined in

CreateSyncStoragePersisterOptions.ts:7