Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaFxObservable.valuesOf(fxObservable, nullSentinel) does not emmit first nullSentinel #75

Open
pkrysztofiak opened this issue Nov 10, 2018 · 1 comment

Comments

@pkrysztofiak
Copy link

pkrysztofiak commented Nov 10, 2018

In my opinion the first/initial emission of nullSentinel is missing:

ObjectProperty<String> stringProperty = new SimpleObjectProperty<>();
JavaFxObservable.valuesOf(stringProperty, "N/A").subscribe(System.out::println);  
stringProperty.set("one");  
stringProperty.set(null);  
stringProperty.set("two");

Output:
one
N/A
two

I would add "else" block just after "if" at ObservableValueSource:50

if (fxObservable.getValue() != null) {
    emitter.onNext(fxObservable.getValue());
} else {
    emitter.onNext(nullSentinel);
}
@thomasnield
Copy link
Collaborator

Noted, okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants