Skip to content

Instantly share code, notes, and snippets.

@fobidlim
Last active September 23, 2016 16:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save fobidlim/f3c66c89f0cf973f798370d322ad2248 to your computer and use it in GitHub Desktop.
RxEvent class
public class RxEvent {
private static RxEvent mInstance;
private PublishSubject<Object> mSubject;
private RxEvent() {
mSubject = PublishSubject.create();
}
public static RxEvent getInstance() {
if (mInstance == null) {
mInstance = new RxEvent();
}
return mInstance;
}
public void sendEvent(Object object) {
mSubject.onNext(object);
}
public Observable<Object> getObservable() {
return mSubject;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment