Jamie
12/31/2021, 3:30 AMcopy() method or equivalent to replicate the samples when invoking value.reduce {}, and the widget doesn't recompose when the observed state value changes.
What am I missing?
EDIT: creating a wrapper data class to hold my sealed class did the trick to make it play nice, though very much open to suggestions if there's a better way to handle this!Arkadii Ivanov
12/31/2021, 12:13 PMwhen first, check for all possible subtypes, and either create initial Loaded, or copy it.Zoltan Demant
12/31/2021, 2:33 PM.apply in your reduce function? That way youre basically updating the value, to the same value. If you use something like .run I believe the value will update to reflect the State.Loaded that youre specifying?Arkadii Ivanov
12/31/2021, 2:44 PMJamie
12/31/2021, 3:50 PMLoaded, Loading and Error classes in the above example definitely aren't needed for the Counter example itself, but I figured the counter would serve as a simple reference to convey what I was trying to achieve.