ReactiveX / RxJavaFX

RxJava bindings for JavaFX
Apache License 2.0
519 stars 67 forks source link

RxJavaFX 2.0 - API Organization #51

Closed thomasnield closed 7 years ago

thomasnield commented 7 years ago

In RxJavaFX 2.0, I have set up JavaFxSubscriber to have toBinding() factories overloaded for both Observable and Flowable. Should I separate these two overloads into two separate static utility classes: JavaFxObserver and JavaFxSubscriber? Just to follow RxJava 2.0 terminology?

thomasnield commented 7 years ago
Binding<String> binding =  Flowable.just("Alpha", "Beta", "Gamma")
        .to(JavaFxSubscriber::toBinding())
Binding<String> binding =  Observable.just("Alpha", "Beta", "Gamma")
        .to(JavaFxObserver::toBinding())
thomasnield commented 7 years ago

I went ahead and made this separation. I'm trying to look for anywhere else the Observable/Flowable distinction might need to be reflected in the API design.

FxTransformers has been split to FxObservableTransformers and FxFlowableTransformers. I can't think of a better way to organize that.

thomasnield commented 7 years ago

I might be able to bring back toLazyBinding() by leveraging a ConnectableObservable and calling connect() on an ObservableValue's getValue() call.

thomasnield commented 7 years ago

I was able to get all the above to work, and have unit tests pass. I'm going to go ahead and do the 2.0.0 release.