KotPreferences
Toggle table of contents
common
Target filter
common
Switch theme
Search in API
Skip to content
KotPreferences
compose
/
com.michaelflisar.kotpreferences.compose
/
collectAsStateWithLifecycle
collect
As
State
With
Lifecycle
@
Composable
fun
<
T
>
StorageSetting
<
T
>
.
collectAsStateWithLifecycle
(
lifecycle
:
Lifecycle
,
initialValue
:
T
?
=
tryGetValueNotNull()
,
minActiveState
:
Lifecycle.State
=
Lifecycle.State.STARTED
,
context
:
CoroutineContext
=
EmptyCoroutineContext
)
:
State
<
T
?
>
@
Composable
fun
<
T
,
X
>
StorageSetting
<
T
>
.
collectAsStateWithLifecycle
(
lifecycle
:
Lifecycle
,
initialValue
:
T
?
=
tryGetValueNotNull()
,
minActiveState
:
Lifecycle.State
=
Lifecycle.State.STARTED
,
context
:
CoroutineContext
=
EmptyCoroutineContext
,
mapper
:
(
T
)
->
X
)
:
State
<
X
?
>
@
Composable
fun
<
T
>
StorageSetting
<
T
>
.
collectAsStateWithLifecycle
(
initialValue
:
T
?
=
tryGetValueNotNull()
,
lifecycleOwner
:
LifecycleOwner
=
LocalLifecycleOwner.current
,
minActiveState
:
Lifecycle.State
=
Lifecycle.State.STARTED
,
context
:
CoroutineContext
=
EmptyCoroutineContext
)
:
State
<
T
?
>
@
Composable
fun
<
T
,
X
>
StorageSetting
<
T
>
.
collectAsStateWithLifecycle
(
initialValue
:
T
?
=
tryGetValueNotNull()
,
lifecycleOwner
:
LifecycleOwner
=
LocalLifecycleOwner.current
,
minActiveState
:
Lifecycle.State
=
Lifecycle.State.STARTED
,
context
:
CoroutineContext
=
EmptyCoroutineContext
,
mapper
:
(
T
)
->
X
)
:
State
<
X
?
>