Erik
01/29/2020, 6:08 PMval currentState: UIState?
provides val typedState: T
, with <T : UIState>
as the generic type and it throws if the current state is null
. Is this something you think is useful in some form? I can make a PR. Another idea could be to pull this up to a new TypedDataFlow
interface. Worth the consideration, what are your thoughts on this?arnaud.giuliani
01/31/2020, 8:19 AMarnaud.giuliani
01/31/2020, 8:20 AMarnaud.giuliani
01/31/2020, 8:20 AMErik
01/31/2020, 9:22 AM<T : UIState>
and can never be null. We could also have a nullable typed version.
The nonnullable version must guarantee that the state getter(s) always return nonnull state
If used with a user's own sealed class hiearachy of UIState
, then this allows for some powerfull state machine modellingarnaud.giuliani
01/31/2020, 9:50 AMarnaud.giuliani
01/31/2020, 9:50 AMarnaud.giuliani
01/31/2020, 9:51 AMarnaud.giuliani
01/31/2020, 9:51 AM