-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
import io.reactivex.rxjavafx.observables.JavaFxObservable;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.stage.Stage;
public class ChangesOfNullApp extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
StringProperty stringProperty = new SimpleStringProperty("firstValue");
JavaFxObservable.changesOf(stringProperty)
.subscribe(change -> System.out.println("oldValue=" + change.getOldVal() + ", newValue=" + change.getNewVal()));
stringProperty.set(null);
stringProperty.set("secondValue");
stringProperty.set("thirdValue");
}
}
The output is:
oldValue=null, newValue=secondValue
oldValue=secondValue, newValue=thirdValue
Imo there is first missing emission which should be logged as:
oldValue=firstValue, newValue=null
Generally there are no change emissions when property was set to null.
Metadata
Metadata
Assignees
Labels
No labels