Join Slack
Communities
Powered by
`.publish().refCount()`
# rx
j
jw
04/27/2018, 5:31 PM
.publish().refCount()
👍 2
u
ursus
04/27/2018, 9:08 PM
But in order to return the same observable you need to cache the observable to some field + behind some if == null check right?
j
jw
04/27/2018, 9:10 PM
No. Create it once and re-use it. Null needn't be involved.
u
ursus
04/27/2018, 9:12 PM
sure eagerly / lazily initializing it, but the point is to actually share the instance, i.e. regular kotlin stuff right?
j
jw
04/27/2018, 9:21 PM
The instance must be shared, yes.
👍 1
Open in Slack
Previous
Next