https://kotlinlang.org logo
#rx
Title
# rx
b

Bruno_

07/10/2020, 10:37 AM
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
blergh sorry for the awful formatting
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
💯 1
2 Views