Getting query result from room database with SharedFlow

Hi I just wonder which code snippet is better for scope while getting query result in SharedFlow val categories = categoryRepository.getAll().shareIn( scope = viewModelScope, started = SharingStarted.WhileSubscribed(5000), replay = 0 ) val categories = categoryRepository.getAll().shareIn( scope = CoroutineScope(Dispatchers.IO), started = SharingStarted.WhileSubscribed(5000), replay = 0 ) >Solution : this is better val categories = categoryRepository.getAll().shareIn( scope… Read More Getting query result from room database with SharedFlow