kkemple/memoize-async

View on GitHub
src/cache.js

Summary

Maintainability
A
0 mins
Test Coverage
export default class Cache {
  constructor() {
    this._cache = {}
  }

  get(k) {
    return this._cache[k]
  }

  set(k, v) {
    this._cache[k] = v
  }

  delete(k) {
    delete this._cache[k]
  }

  clear() {
    delete this._cache
    this._cache = {}
  }
}