Is it a good practice to create a new (`Completabl...
# rx
i
Is it a good practice to create a new (
Completable
) subscription on click? I developed the habit lately to use a
PublishSubject
trigger and subscribe to it in
init
, but saw code again that uses the "subscription on tap" pattern and I'm wondering whether my pattern is overkill?
a
What's the
Completable
doing? The only that that comes to my mind is if you're doing something like making a network call or doing something expensive you may want to
debounce
the source. Otherwise I don't see why creating a new
Completable
on tap is a bad move.
u
depends if you want to control the paralelism somehow (switchmap, concatmap, debounce etc), if not, the it doesnt matter
i
network call
well, yeah, I can't think of reasons not to create a new subscription each time
(aside from what you mentioned, but I don't need this)