After nearly a year of controlled experimentation and prototyping, RxJavaFX 1.0.0 has finally been released. There should be no breaking changes to upgrade to this version, however there are some sweeping deprecations as well as some new features.
- Nearly all factories in
JavaFxObservablehave been deprecated and replaced with more concise factory names inspired by ReactFX. For instance,
valuesOf(). The RxJavaFX Guide will be updated later to reflect these new naming conventions.
JavaFxObservable, there are now
nonNullChangesOf()factories that effectively supress null values emitted from an
CompositeObservable@Beta tag has been removed.
- A new set of Transformers have been provided via the
JavaFxTransformersstatic class. These are new Rx operators specific to JavaFX
doOnNextFx()- same as
doOnNext()but executes on FX thread
doOnCompletedFx()- same as
doOnCompleted()but executes on FX thread
doOnErrorFx()- same as
doOnError()but executes on FX thread
doOnSubscribeFx()- same as
doOnSubscribe()but executes on FX thread
doOnUnsubscribeFx()- same as
doOnUnsubscribe()but executes on FX thread
doOnTerminateFx()- same as
doOnTerminate()but executes on FX thread
doOnNextCount()- performs the provided action with the emission count for each
doOnCompletedCount()- performs the provided action with the emission count for an
doOnErrorCount()- performs the provided action with the emission count for an
doOnNextCountFx()- same as
doOnNextCount()but executes on FX thread
doOnCompletedCountFx()- same as
doOnCompletedCount()but executes on FX thread
doOnErrorCountFx()- same as
doOnErrorCount()but executes on FX thread
doOnXXXCount() operators are helpful for updating the UI with a status on how many emissions have been processed (e.g. through a
ProgressBar or a simple
Label with the count).
1.x branch is now the primary branch. Next on the roadmap is to implement this library with RxJava 2.0 on the
2.x branch. RxJava 2.0 brings some drastic changes with it and we will need a separate RxJavaFX 2.0 implementation to support it.
RxKotlinFX will get a 1.0 release this week as well.
CompositeObservablewith a serialized
PublishSubject, allowing sources to be removed from a
CompositeObservableat any time.
CompositeObservable#add()now returns a
Subscriptionthat can be used to
CompositeObservablefrom a source
addAll()will return a
CompositeSubscriptioncontaining all the Subscriptions.
getSources()were removed from
CompositeObservableas they are no longer are relevant due to above changes.
This release might break any previous usages of
CompositeObservable, which now optionally accepts a
Transformer. Any other constructors to control caching have been removed, as these were broken and now remedied by this new solution.
CompositeObservable is modified to optionally accept a
Transformer as a constructor argument. This
Transformer is applied to the combined
Observable so as to allow further manipulations yielded by
You can leverage this
Transformer to multicast the outputted
Observable or (as shown in the example below) replay the last emission from the combined emissions.
CompositeObservable<String> source = new CompositeObservable<>(obs -> obs.replay(1).refCount()); source.toObservable().subscribe(System.out::println); source.add(Observable.just("Alpha","Beta","Gamma")); source.add(Observable.just("Delta","Epsilon")); Thread.sleep(1000); source.toObservable().subscribe(System.out::println);
Alpha Beta Gamma Delta Epsilon Epsilon
CompositeObservable dupe issue from 0.1.2
CompositeObservable for merging multiple Observables, but allows Observables to be added/removed at any time. Helpful for consolidating multiple UI event sourcesx
Removed dupe initial emission from ObservableSetSource.fromObservableSet() factory
CompositeObservable for merging multiple Observables, but allows Observables to be added/removed at any time. Helpful for consolidating multiple UI event sources
Removed dupe initial emission from
JavaFxObservable.fromDialog()factory which will emit the result of a
JavaFxObservable.fromObservableList()now does an initial emission of the
ObservableListbefore any changes occur.
JavaFxObservable.fromObservableMap()now does an initial emission of the
ObservableMapbefore any changes occur.
JavaFxObservable.fromObservableSet()now does an initial emission of the
ObservableSetbefore any changes occur.
Two new functionalities were added to this release.
Added following factory to emit consecutive
Long values at a set interval on the JavaFX thread. See #34
Lazy RxJava Bindings
Binding factories were added to turn an RxJava
Observable into a JavaFX
Binding, and now there is an option to call
toLazyBinding() and not just
toBinding(). This will result in the
Binding implementation delaying subscription to the
Observable until a value is requested from it. #35.
JavaFxSubscriber.toLazyBinding(Observable<T> observable) JavaFxSubscriber.toLazyBinding(Observable<T> observable, Action1<Throwable> onError)