louiscad
06/22/2020, 1:26 PMMutableStateFlow
can be used for databinding. Did anyone try that yet?wasyl
06/22/2020, 1:33 PMLiveData
?louiscad
06/22/2020, 1:34 PMMutableStateFlow
(edited).
@wasyl I mean you can hand it to UI code, and it will get the current value, the updates, and be able to push a new value.streetsofboston
06/22/2020, 1:35 PMlouiscad
06/22/2020, 1:38 PMstreetsofboston
06/22/2020, 1:38 PMEventFlow
and StateFlow
on a prototype KMP project (targeting Android and iOS).Robert Jaros
06/22/2020, 1:48 PMStateFlow
for databinding with observable components. But I haven't used this functionality in any real project yet.andylamax
06/22/2020, 2:01 PMlouiscad
06/22/2020, 2:06 PMMutableStateFlow
to the part of the code that will manage the UI, or a part of it.
I pass it as part of a cancellable suspending function (for when that UI part needs to be disabled), and in that function, I collect the StateFlow
with collectLatest
or alike, update the UI, and wait for user interaction to input a new value that is then put into the same MutableStateFlow
.Zach Klippenstein (he/him) [MOD]
06/22/2020, 2:20 PM