Created
October 9, 2017 10:43
-
-
Save enq3/c617eac125636ae30ddd8b8b50a34f5c to your computer and use it in GitHub Desktop.
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 LocalRxBus { | |
private static LocalRxBus instance; | |
private PublishSubject<Object> subject = PublishSubject.create(); | |
public static LocalRxBus instance() { | |
if (instance == null) { | |
instance = new LocalRxBus(); | |
} | |
return instance; | |
} | |
public void setObject(Object object) { | |
subject.onNext(object); | |
subject.onComplete(); | |
} | |
public Observable<Object> getObject() { | |
return subject; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment