diff --git a/app/src/main/java/j4ckall/rxflux/lib/flux/Dispatcher.java b/app/src/main/java/j4ckall/rxflux/lib/flux/Dispatcher.java index a578b60..b0ba0a2 100644 --- a/app/src/main/java/j4ckall/rxflux/lib/flux/Dispatcher.java +++ b/app/src/main/java/j4ckall/rxflux/lib/flux/Dispatcher.java @@ -15,6 +15,7 @@ public class Dispatcher { private final Subject dispatcherSubject = PublishSubject.create().toSerialized(); + private final Observable dispatch = dispatcherSubject.hide(); public Dispatcher() { } @@ -39,4 +40,14 @@ final void dispatch(Action fluxAction) { dispatcherSubject.onNext(fluxAction); } + + /** + * dispatcherSubjectは公開したくない(外部からonNext出来る)ので + * Observableに変換して返す + * + * @return Observable + */ + public Observable getDispatch() { + return dispatch; + } }