@ascentbv/ts-common - v1.0.199
Preparing search index...
TypedCache
Class TypedCache<K, V>
Type Parameters
K
V
Index
Constructors
constructor
Methods
get
Or
Compute
set
get
has
delete
clear
stats
reset
Stats
tick
for
Each
Constructors
constructor
new
TypedCache
<
K
,
V
>
(
name
:
string
,
options
?:
CacheOptions
)
:
TypedCache
<
K
,
V
>
Type Parameters
K
V
Parameters
name
:
string
options
:
CacheOptions
= {}
Returns
TypedCache
<
K
,
V
>
Methods
get
Or
Compute
getOrCompute
(
key
:
K
,
compute
:
()
=>
V
)
:
V
Parameters
key
:
K
compute
:
()
=>
V
Returns
V
set
set
(
key
:
K
,
value
:
V
)
:
void
Parameters
key
:
K
value
:
V
Returns
void
get
get
(
key
:
K
)
:
V
|
undefined
Parameters
key
:
K
Returns
V
|
undefined
has
has
(
key
:
K
)
:
boolean
Parameters
key
:
K
Returns
boolean
delete
delete
(
key
:
K
)
:
void
Parameters
key
:
K
Returns
void
clear
clear
()
:
void
Returns
void
stats
stats
()
:
{
hits
:
number
;
misses
:
number
;
size
:
number
}
Returns
{
hits
:
number
;
misses
:
number
;
size
:
number
}
reset
Stats
resetStats
()
:
void
Returns
void
tick
tick
()
:
void
Returns
void
for
Each
forEach
(
callback
:
(
value
:
V
,
key
:
K
)
=>
void
)
:
void
Parameters
callback
:
(
value
:
V
,
key
:
K
)
=>
void
Returns
void
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
get
Or
Compute
set
get
has
delete
clear
stats
reset
Stats
tick
for
Each
@ascentbv/ts-common - v1.0.199
Loading...