Class: LRUCache

ol/structs/LRUCache~LRUCache


Implements a Least-Recently-Used cache where the keys do not conflict with Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring items from the cache is the responsibility of the user.

Fires:
  • change (BaseEvent) - Generic change event. Triggered when the revision counter is increased.
  • error (BaseEvent) - Generic error event. Triggered when an error occurs.

Methods

setSize(size)

Set a maximum number of entries for the cache.

Name Type Description
size number

Cache size.