Type Parameters
-
V = any
-
O extends Record<string, unknown> = Record<string, unknown>
Constructors
constructor
- new default<V, O>(options?): default<V, O>
-
Type Parameters
-
V = any
-
O extends Record<string, unknown> = Record<string, unknown>
Parameters
-
options: CacheOptions = {}
Methods
add
- add(key, valueToSet, props?, onlyFull?): V
-
Parameters
-
key: string
-
valueToSet: V | (() => V)
-
Optional
props: CacheMatchProps<O>
-
Optional
onlyFull: boolean
Returns V
addFull
- addFull(key, valueToSet, props?): V
-
Parameters
-
key: string
-
valueToSet: V | (() => V)
-
Optional
props: CacheMatchProps<O>
Returns V
all
- all(): CacheItem<V, O>[]
-
Returns CacheItem<V, O>[]
clean
- clean(): void
-
Returns void
delete
- delete(item): void
-
Parameters
-
item: CacheItem<any, any>
Returns void
- delete(key, props?): void
-
Parameters
-
key: string
-
Optional
props: CacheMatchProps<O>
Returns void
match
- match(key, props?): undefined | V
-
Parameters
-
key: string
-
Optional
props: CacheMatchProps<O>
Returns undefined | V
matchAll
- matchAll(key?, props?): V[]
-
Parameters
-
Optional
key: string
-
Optional
props: CacheMatchProps<O>
Returns V[]
Example
Example