The type of the data to serialize and deserialize.
The type of the data to store.
Creates a new instance of the StorageDriver class.
The name of the storage driver.
The serializer to use for serializing and deserializing data.
If driver does not support onUpdate, use this to notify with external event.
Optionalprocessor: Loadable<IStoreProcessor<Output>>The store processor to use for processing data before it is written to storage and after it is loaded from storage.
Optionallogger: ILoggerLikeThe logger to use for logging messages.
ReadonlybandwidthIndicates the speed of the storage driver.
ReadonlyloggerReadonlynameThe name of the storage driver.
ReadonlyserializerIndicates whether or not the storage driver has been initialized.
Clear the stored data
Clear the stored data and return the Promise of Result.
A promise of Result that resolves when the data has been successfully cleared.
Retrieves the processor for the storage driver if it is available.
The processor for the storage driver, or undefined if no processor is available.
Retrieves the processor for the storage driver if it is available and returns the Promise of Result.
The processor for the storage driver, or undefined if no processor is available.
Get the serializer for the storage driver.
The serializer for the storage driver.
ProtectedhandleClear the stored data in storage.
A promise that resolves when the data has been successfully cleared.
ProtectedhandleRetrieve the data from storage.
A promise that resolves to the retrieved data, or undefined if no data was found.
ProtectedhandleInitialize the storage driver.
A promise that resolves to true if the storage driver was successfully initialized, or false otherwise.
ProtectedhandleStore the given data to storage.
A promise that resolves when the data has been successfully stored.
ProtectedhandleCalled when the storage driver is unloaded.
A promise that resolves to true if the storage driver was successfully unloaded, or false otherwise.
ProtectedhandleUse this to indicate that the data has been updated.
Retrieves the data stored using the specified key.
The options to use for hydrating the data.
The retrieved data, or undefined if no data was found.
Retrieves the data stored using the specified key and returns the Promise of Result.
Optionaloptions: IHydrateOptionsThe options to use for hydrating the data.
Promise of Result that resolves to the retrieved data, or undefined if no data was found.
Initializes the storage driver.
A promise that resolves to true if the storage driver was successfully initialized, or false otherwise.
Initializes the storage driver and returns the Promise of Result.
Promise of the result object, see Result
Set the data to store and emit an update.
The data to store.
A promise that resolves when the data has been successfully stored.
Stores the given data using the specified key.
The data to store.
Stores the given data using the specified key and returns the Promise of Result.
The data to store.
A promise of Result that resolves when the data has been successfully stored.
Build the default JSON representation of the storage driver.
The JSON representation of the storage driver.
Returns a string representation of an object.
Unload the storage driver.
A promise that resolves to true if the storage driver was successfully unloaded, or false otherwise.
Unload the storage driver and return the Promise of Result.
A promise of Result that resolves to true if the storage driver was successfully unloaded, or false otherwise.
A storage driver that stores data in memory.
Since
v0.6.0
Example