ReactFX Val, how do I get binding for null status?

89 Views Asked by At

In JavaFX's Property you can obtain a boolean binding for null or non null via val.isNull() and val.isNonNull().

What's the equivalence for this in ReactFX?

I've tried:

val.map(v -> v == null)

But it would return a Val<Boolean> with the actual value null instead of true (which is as expected in other cases).

1

There are 1 best solutions below

3
On BEST ANSWER

I think

val.map(v -> false).orElseConst(true)

will give you what you need.