File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/main/java/io/reactivex/rxjavafx Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1616package io .reactivex .rxjavafx .observables ;
1717
1818
19+ import io .reactivex .Maybe ;
1920import io .reactivex .Observable ;
2021import io .reactivex .rxjavafx .sources .*;
2122import javafx .beans .value .ObservableValue ;
@@ -367,9 +368,9 @@ public static Observable<Long> interval(final Duration duration) {
367368 }
368369
369370 /**
370- * Returns an Observable that emits the T response of a Dialog. If no response was given then the Observable will be empty.
371+ * Returns a Maybe that emits the T response of a Dialog. If no response was given then the Maybe will be empty.
371372 */
372- public static <T > Observable <T > fromDialog (Dialog <T > dialog ) {
373+ public static <T > Maybe <T > fromDialog (Dialog <T > dialog ) {
373374 return DialogSource .fromDialogSource (dialog );
374375 }
375376}
Original file line number Diff line number Diff line change 1515 */
1616package io .reactivex .rxjavafx .sources ;
1717
18- import io .reactivex .Observable ;
18+ import io .reactivex .Maybe ;
19+ import io .reactivex .Single ;
1920import io .reactivex .rxjavafx .schedulers .JavaFxScheduler ;
2021import javafx .scene .control .Dialog ;
22+
2123import java .util .Optional ;
2224
2325public final class DialogSource {
2426 private DialogSource () {}
2527
26- public static <T > Observable <T > fromDialogSource (final Dialog <T > dialog ) {
27- return Observable .fromCallable (dialog ::showAndWait )
28+ public static <T > Maybe <T > fromDialogSource (final Dialog <T > dialog ) {
29+ return Single .fromCallable (dialog ::showAndWait )
2830 .subscribeOn (JavaFxScheduler .platform ())
2931 .filter (Optional ::isPresent )
3032 .map (Optional ::get );
You can’t perform that action at this time.
0 commit comments