Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/core/cache/simple

core/cache/simple

This module provides a class for a simple in-memory Cache data structure.

import SimpleCache from 'core/cache/simple';

const
cache = new SimpleCache();

cache.set('foo', 'bar1');
cache.set('foo2', 'bar2');
cache.set('baz', 'bar3');

console.log(cache.keys().length); // 3

cache.clear((val, key) => /foo/.test(key));

console.log(cache.keys().length); // 1

API

See Cache.

Index

References

Classes

References

Re-exports ClearFilter