Erik
02/18/2021, 7:39 PMaction {}
return ActionFlow
instead of Unit
, is there a use case to have that object somewhere outside of the Uniflow internals?arnaud.giuliani
02/19/2021, 8:36 AMActionFlow
to be valid. There is a validator for testing your ViewModel in the uniflow-test moduleErik
02/19/2021, 12:16 PMDataFlow
if a write a function as fun getWeather() = action { /*..*/ }
then my data flow exposes the returned ActionFlow
object to the caller. Why is that necessary? The public API of the ActionFlow
class has all kinds of properties and functions that should likely never be called or callable from outside of a DataFlow
. Do you have an example of where having all this access is useful?DataFlow
to just expose a function fun submit(): Unit
. Of course I could write
fun submit() {
action { /*..*/ }
}
But then I actively must ignore the returned value from action { /*..*/ }
. What is its intended use?
Furthermore, wouldn't it be nicer to be able to write
fun submit() = action { /*..*/ }
while Unit
is returned, indicating that the submit function is fire and forget: it returns quickly but ensures that an action is submitted to its internals that might (or might not) lead to events and state changes.DataFlow
functions must return an ActionFlow
.arnaud.giuliani
02/22/2021, 8:43 AMI’ve seen the validator now and I understand what it validates, but I still don’t understand why all publicYes, I see your pointfunctions must return anDataFlow
.ActionFlow