zak.taccardi
11/28/2016, 10:56 PM.mergeWith() and .ignoreElements(), while a little verbose and ugly, did the trick for me.
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 } )