Toolkit
Toggle table of contents
1.7.7
common
Target filter
common
Switch theme
Search in API
Skip to content
Toolkit
compose
/
glass.yasan.toolkit.compose.viewmodel
/
ToolkitViewModel
Toolkit
View
Model
abstract
class
ToolkitViewModel
<
S
:
ViewState
,
E
:
ViewEvent
,
A
:
ViewAction
>
:
ViewModel
Members
Constructors
Toolkit
View
Model
Link copied to clipboard
constructor
(
)
Properties
view
Action
Link copied to clipboard
val
viewAction
:
Flow
<
A
>
view
State
Link copied to clipboard
val
viewState
:
StateFlow
<
S
>
Functions
add
Closeable
Link copied to clipboard
expect
open
fun
addCloseable
(
closeable
:
AutoCloseable
)
expect
fun
addCloseable
(
key
:
String
,
closeable
:
AutoCloseable
)
default
View
State
Link copied to clipboard
abstract
fun
defaultViewState
(
)
:
S
get
And
Update
View
State
Link copied to clipboard
fun
getAndUpdateViewState
(
transform
:
S
.
(
)
->
S
)
:
S
get
Closeable
Link copied to clipboard
expect
fun
<
T
:
AutoCloseable
>
getCloseable
(
key
:
String
)
:
T
?
on
View
Event
Link copied to clipboard
abstract
suspend
fun
onViewEvent
(
event
:
E
)
send
View
Action
Link copied to clipboard
fun
sendViewAction
(
action
:
A
)
send
View
Event
Link copied to clipboard
fun
sendViewEvent
(
event
:
E
)
state
In
Link copied to clipboard
fun
<
T
>
Flow
<
T
>
.
stateIn
(
started
:
SharingStarted
,
initialValue
:
T
)
:
StateFlow
<
T
>
state
In
Eagerly
Link copied to clipboard
fun
<
T
>
Flow
<
T
>
.
stateInEagerly
(
initialValue
:
T
)
:
StateFlow
<
T
>
state
In
Lazily
Link copied to clipboard
fun
<
T
>
Flow
<
T
>
.
stateInLazily
(
initialValue
:
T
)
:
StateFlow
<
T
>
state
In
While
Subscribed
Link copied to clipboard
fun
<
T
>
Flow
<
T
>
.
stateInWhileSubscribed
(
stopTimeout
:
Duration
=
5.seconds
,
replayExpiration
:
Duration
=
Duration.INFINITE
,
initialValue
:
T
)
:
StateFlow
<
T
>
update
And
Get
View
State
Link copied to clipboard
fun
updateAndGetViewState
(
transform
:
S
.
(
)
->
S
)
:
S
update
View
State
Link copied to clipboard
fun
updateViewState
(
transform
:
S
.
(
)
->
S
)