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

kioba

04/11/2019, 5:13 PM
is that what you are looking for?
w

william

04/11/2019, 6:40 PM
trying to digest it now
why the use of a sealed class / object rather than enum?
k

kioba

04/12/2019, 7:34 AM
Enum is good too. I use sealed hierarchy if in the future I need to allow data to be provided in the stream. IE:
Copy code
data class Loosing(val maxMsToLive: Long) : Connectivity()
also someone correct me if im wrong but it seems to be that
Subject
usage can sometimes be a code smell
Yes, Subject is a code smell from my point of view.. try to hide it from your api
w

william

04/14/2019, 3:47 PM
do you think its more to hide from the api rather than not to use?
like is it so bad to use a subject or to expose it as a subject?
k

kioba

04/15/2019, 8:41 AM
Using a subject is okay, there are good usecasees for it. exposing a subject opens up too many possibilities, hiding it behind your api restricts the usage to your usecase.
w

william

04/19/2019, 12:23 PM
thank you for the response here - its rare i get to use a switchmap for an actual use
👍 1