Last active
September 23, 2016 16:11
Star
You must be signed in to star a gist
RxEvent class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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