Jason Ankers
03/16/2021, 3:49 AMprivate val workouts = flow { emit(userRepository.getWorkouts()) }
private val exercises = flow { emit(userRepository.getExercises()) }
val workoutsByExerciseId: Flow<Map<String, Workout>> = ? // do some transformation which combines both sources
I want to create workoutsByExerciseId
which should depend on both workouts
and exercises
. If either source changes, workoutsByExerciseId
should always re-emit with the latest data. Which flow operator do I need here?Natsuki(开元米粉实力代购)
03/23/2021, 3:19 PMcombine
?