Can't find the operator I need so I have to ask. I have a facade and I want to return something like a hot (already subscribed) completable from it. Any ideas?
Basically I want to call the facade from a controller and just let it do it's work. But there's other use case in which I want to wait for the completion.
a
alexsullivan114
07/10/2020, 12:58 PM
cache
might be what you want:
fun getMyCompletable(): Completable {
val completable = Completable.complete().share()
completable.subscribe()
return completable
}
❤️ 1
alexsullivan114
07/10/2020, 12:59 PM
blergh sorry for the awful formatting
alexsullivan114
07/10/2020, 12:59 PM
Also the above is just an example, please don't make a side effectful getter like that 😛
u
ursus
07/11/2020, 12:24 PM
you need to store it a field, your thijg will create a new instance every call