Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Blog post snippet
// don't start emitting items just yet by turning the observable to a connected one
ConnectableObservable<Object> tapEventEmitter = _rxBus.toObserverable().publish();
tapEventEmitter.publish((Func1) (stream) -> {
// inside `publish`, "stream" is truly multicasted
// applying the same technique for getting a debounced buffer sequence
return stream.buffer(stream.debounce(1, TimeUnit.SECONDS));
}).subscribe((Action1) (taps) {
_showTapCount(taps.size());
});
// start listening to events now
tapEventEmitter.connect();

jemshit commented Sep 22, 2017

operatorCeption :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment