Stylistic question - I've started to use the `shar...
# rx
a
Stylistic question - I've started to use the
share
operator a lot to improve code readability, but I'm on the fence about it. Example of some code pre-share:
Copy code
myObservable
   .map { convertToSomethingElse(it) } 
   .filter { filterSomeProperty }
   .subscribe {
       logSomething()
       updateComponent1()
       updateComponent2(it)
       notifySomethingElse()
   }
vs
Copy code
val sharedObservable = myObservable
    .map { convertToSomethingElse(it) } 
    .filter { filterSomeProperty() }
    .share()

sharedObservable
    .subscribe { logSomething() }

sharedObservable
    .subscribe { updateComponent1() }

...