Anyone have a suggestion for how to do things like...
# announcements
m
Anyone have a suggestion for how to do things like .map and .filter on a StateFlow without converting it to regular Flow object? Or does that just not make much logical sense? I can see how composition like that can throw a wrench into the current value management, but it seems like it’s kind of a miss.
m
Does not make sense doing that.
.map
for example will transform the value for one downstream Flow. But other Flows may work on the original value. If you want your transformed value to be a state again and be saved, then use
Copy code
originalStateFlow
   .map { … }
   .stateIn(…)
m
Thanks. That’s what i was missing
Though i suspect i need a version upgrade for that. we’re currently on 1.3.7, and i don’t expect that 1.3.9 would have new functions. I’m guessing it’s in 1.4.0 which isn’t full release yet
m
Yup, that’s 1.4.0-M1