MemoizeWithLRU<R> class
Creates a memoized function with LRU (Least Recently Used) eviction.
Prevents unbounded memory growth by evicting the least recently used entries when the cache reaches its maximum size.
Constructors
- MemoizeWithLRU(R _fn(List args), {required String keyFn(List args), int maxCacheSize = 100})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxCacheSize → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
Number of cached entries.
no setter
Methods
-
call(
List args) → R -
clear(
) → void - Clear the cache.
-
delete(
String key) → bool - Delete a specific key.
-
get(
String key) → R? - Get a value without updating recency.
-
has(
String key) → bool - Check if the cache contains a key.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited