@accumulators/core
v4.2.3
Published
A collection of TypeScript accumulators packages, each using the core package
Downloads
76
Readme
core
Store
Store is a class that provides a simple interface for storing and retrieving key-value pairs.
Store has the following interface:
interface IStore {
get(key: string): Promise<string | undefined>;
getMany(keys: string[]): Promise<Map<string, string>>;
set(key: string, value: string): Promise<void>;
setMany(values: Map<string, string>): Promise<void>;
delete(key: string): Promise<void>;
deleteMany(keys: string[]): Promise<void>;
}
Implementations
Store can be implemented in many different ways, for example in memory or database.
Currently there are three implementations:
You can also implement your own store. Just write a class that implements IStore
interface and you are good to go.