Hello... I have a fun in another usecase layer whi...
# android
a
Hello... I have a fun in another usecase layer which return Observable.
Copy code
override fun getUpdates(): Observable<Model>
How can I handle this from the presenter layer using kotlin coroutines? I need scheduler in the presenter layer.e
g
Using Kotlin coroutines? You mean convert this method with coroutines? Just use Flow
Or if you want to use existing method and make it coroutines friendly, you can convert this Observable to Flow using asFlow() extension
Control of schedulers is the same as without coroutines, just use observeOn if you use Observable or flowOn if Flow
a
nice thanks.
asFlow
work for me