Create a gist now

Instantly share code, notes, and snippets.

snippet hack to make share operator hot
storeObservable =
Observable.interval(1, TimeUnit.SECONDS)
.map(new Func1<Long, Integer>() {
@Override
public Integer call(Long aLong) {
return aLong.intValue();
}
})
.take(20)
.share();
// Do not do this in production!
// this is a hack!
storeObservable = storeObservable.subscribe();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment