David Breneisen
09/06/2025, 10:13 AMstreetsofboston
09/06/2025, 11:02 AMDavid Breneisen
09/06/2025, 11:38 AMDavid Breneisen
09/06/2025, 11:42 AMstreetsofboston
09/06/2025, 12:10 PMDavid Breneisen
09/06/2025, 12:30 PMDavid Breneisen
09/06/2025, 12:32 PMstreetsofboston
09/06/2025, 12:41 PMStateFlow = stateFlow.filter { it > 20 }
What would otherStateFlow.value
return...?David Breneisen
09/06/2025, 12:49 PMIan Lake
09/06/2025, 2:20 PMstateFlow.map { getExpensiveDataFromNetwork(it) }
), so they don't necessarily synchronously produce a .value
in the first place, so you do need some initial value before all those operations actually return anythingDavid Breneisen
09/06/2025, 3:02 PMDavid Breneisen
09/06/2025, 3:05 PMAhmed
09/06/2025, 5:48 PMval user = userRepo.getUser()
.stateIn(
initialValue = null,
…
)
val activities = activitiesRepo.getActivities(coordinates)
.stateIn(
initialValue = listOf(CYCLING, WALKING, HIKING, .. etc),
…
)
val canUserHaveFun = combine(
user,
activities
) { user, activities ->
user.preference in activities
}
// ------ THIS IS A FLOW ATM UNLESS stateIn() is USED -----
.stateIn(
initialValue = false, // A simple example was used but at times this can be quite complex.
…
)
They just want to have an option to not use stateIn()
for canUserHaveFun
when it is more of derived stateflow from stateflows with initial values.streetsofboston
09/06/2025, 5:52 PMstreetsofboston
09/06/2025, 5:53 PMstateFlow.map(::someFunction).stateIn(... intialValue=someFunction(stateFlow.value)...)
Ahmed
09/06/2025, 5:54 PMDavid Breneisen
09/06/2025, 9:44 PMDavid Breneisen
09/06/2025, 9:48 PMstreetsofboston
09/06/2025, 9:53 PMDavid Breneisen
09/06/2025, 10:44 PMZach Klippenstein (he/him) [MOD]
09/08/2025, 3:56 AMDavid Breneisen
09/08/2025, 9:40 PM