list of entires to pre-populate the timed-map with
The core map data, used to keep track of the data itself.
A map of timers where the key is the same key provided
to the _core
map.
Event handler triggered whenever an item from the map is expired
Returns the number of key/value pairs in the TimedMap
object
Removes all key-value pairs from the TimedMap
object.
Returns true
if the element in the Map
object existed and has been removed,
or false
if the element does not exist. has
will return false
afterwards.
the key to remove
Returns a new Iterator
object that containers an array of [key, value]
for each element in the Map
object in insertion order.
Calls ``callbackFnonce each key-value pair present in the
Mapobject, in insertion order. If a
thisArgparameter is provided to
forEach, it will be used as
this` value for each callback
TODO: check typing for thisArg
object
Returns the value at the given key, if there is one
the key to get
Gets the remaining time for an entry given a key. This is just an estimation - the environment ultimately determines when the removal is executed.
the key of an entry in the map
The amount of milliseconds left before the entry is ejected, or undefined
if the key or timer does not exist
Returns a boolean asserting whether a value has been associated
to the key
in the Map
object or not.
Returns a new Iterator
object that contains the keys for each element
in the Map
object in insertion order
Sets the value for the key in the Map
object. Returns the Map
object.
Gets a list of remaining timers.
sort key to determine order of timers. Defaults to insertion order.
A list of remaining timers sorted using order
Resets a timer or updates its expiration time
time to set the timer to
Returns a new Iterator
object that contains values for each element in the Map
object in
insertion order.
Generated using TypeDoc
Es6TimedMap An es6-map-like utility class with time based functions and support.
Due to the similar surface area, use the Map doc reference from here