<@U0BFDUP0E> a combination of `.mergeWith()` and `...
# rx
z
@jw a combination of
.mergeWith()
and
.ignoreElements()
, while a little verbose and ugly, did the trick for me.
Copy code
Observable.just(null)
                            .mergeWith(
                                    //takes a function that will be executed when data is considered "stale"
                                    staleDataObservatory.register({ jobFactory.serialize(startingPoint, businessId) })
                                            .ignoreElements()
                                            .cast(Nothing::class.java)
                            )
                            .flatMap { db.observe(businessId) }
                            .replayingShare()
All syncing logic is encapsulated in that
staleDataObservatory
class, as long as someone is observing it (calls
.register( { //function } )