So right now I'm reading about RxJavaFX and stumbled upon the following example:
var comboBox = new ComboBox <String> ();
comboBox.getItems().setAll("Alpha", "Beta", "Gamma", "Delta", "Epsilon");
JavaFxObservable.valuesOf(comboBox.valueProperty())
.subscribe(v - > System.out.println(v + " was selected "));
Why would I use the example above instead of this?
var comboBox = new ComboBox <String> ();
comboBox.getItems().setAll("Alpha", "Beta", "Gamma", "Delta", "Epsilon");
comboBox.setOnAction(ae -> System.out.println(comboBox.getValue()));
I can't see the benefit of using RxJavaFX here. What am I missing?