trixnity-client
3.4.1
trixnity-client
/
net.folivo.trixnity.client.store.cache
/
StateFlowCache
State
Flow
Cache
open
class
StateFlowCache
<
K
,
V
>
(
name
:
String
,
cacheScope
:
CoroutineScope
,
val
expireDuration
:
Duration
=
1.minutes
)
Constructors
Functions
Properties
Inheritors
Constructors
State
Flow
Cache
Link copied to clipboard
fun
StateFlowCache
(
name
:
String
,
cacheScope
:
CoroutineScope
,
expireDuration
:
Duration
=
1.minutes
)
Functions
init
Link copied to clipboard
fun
init
(
initialValues
:
Map
<
K
,
V
>
)
read
With
Cache
Link copied to clipboard
fun
readWithCache
(
key
:
K
,
isContainedInCache
:
suspend
(
cacheValue
:
V
?
)
->
Boolean
,
retrieveAndUpdateCache
:
suspend
(
cacheValue
:
V
?
)
->
V
?
)
:
Flow
<
V
?
>
reset
Link copied to clipboard
fun
reset
(
)
write
With
Cache
Link copied to clipboard
suspend
fun
writeWithCache
(
key
:
K
,
updater
:
suspend
(
oldValue
:
V
?
)
->
V
?
,
isContainedInCache
:
suspend
(
cacheValue
:
V
?
)
->
Boolean
,
retrieveAndUpdateCache
:
suspend
(
cacheValue
:
V
?
)
->
V
?
,
persist
:
suspend
(
newValue
:
V
?
)
->
StateFlow
<
Boolean
>
?
)
Properties
cache
Link copied to clipboard
val
cache
:
SharedFlow
<
Map
<
K
,
StateFlow
<
V
?
>
>
>
expire
Duration
Link copied to clipboard
val
expireDuration
:
Duration
Inheritors
MinimalRepositoryStateFlowCache
Link copied to clipboard