Skip to content

Instantly share code, notes, and snippets.

@feresr
Last active February 5, 2017 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feresr/fd221c513e8fc515d0257a679d812c36 to your computer and use it in GitHub Desktop.
Save feresr/fd221c513e8fc515d0257a679d812c36 to your computer and use it in GitHub Desktop.
RxRelayAwesome
public void execute() {
//doesn't actually execute anything just yet... just creates the observable
observable = endpoints.getJoke().doOnNext(joke -> storage.save(joke));
}
public Subscription subscribe(Subscriber<Joke> subscriber) {
return observable.subscribe(subscriber);
}
public final void unsubscribe(Subscription subscription) { } //unsubscribe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment