interface LifetimeFilterOptions

export interface LifetimeFilterOptions<Key, Value>

Options for generating a filter function based on lifetime

Type Parameters

Key

Value

external
excludeFromSweep : function = () =undefined false

A function that takes an entry, key, and the collection and returns a boolean, true when the entry should not be checked for sweepability.

external
getComparisonTimestamp : function = e =undefined e?.createdTimestamp

A function that takes an entry, key, and the collection and returns a timestamp to compare against in order to determine the lifetime of the entry.

optional
lifetime? : number = 14400

How long, in seconds, an entry should stay in the collection before it is considered sweepable.

optional
excludeFromSweep(
value: Value
key: Key
) : boolean

optional
getComparisonTimestamp(
value: Value
key: Key
) : number