import { Injectable } from '@angular/core';
import { StorageProvider } from './storage-provider';

@Injectable({ providedIn: 'root' })
export class MemoryStorageProvider implements StorageProvider {
  #store = new Map<string, unknown>();

  set(key: string, value: unknown): void {
    this.#store.set(key, value);
  }

  get(key: string): unknown {
    return this.#store.get(key);
  }

  clear(key: string): void {
    this.#store.delete(key);
  }
}
