```sh npm i @azot-dev/cortex-storage-stub-adapter ``` or ```sh yarn add @azot-dev/cortex-storage-stub-adapter ```
npm install @azot-dev/cortex-storage-stub-adapter``sh`
npm i @azot-dev/cortex-storage-stub-adapter`
orsh`
yarn add @azot-dev/cortex-storage-stub-adapter
`ts
export * from '../storage.gateway';
import { StorageGateway } from '../storage.gateway';
export class StubStorageAdapter implements StorageGateway {
private storage: Record
getItem(key: string) {
return this.storage[key];
}
async setItem(key: string, value: any) {
this.storage[key] = value;
}
async removeItem(key: string) {
delete this.storage[key];
}
async clear() {
this.storage = {};
}
async getAllKeys() {
return Object.keys(this.storage);
}
}
`
`ts``
export interface StorageGateway {
getItem(key: string): Promise
setItem(key: string, value: any): Promise
removeItem(key: string): Promise
clear(): Promise
getAllKeys(): Promise
}