Builds function which executes a given callback only if value is not undefined or null. The created function will have a "else" method, which can be used to bind default values.
Optional
to execute if value is defined.
transformer function.
let a = new Clazz();let b = new Clazz();Binding.for(a, b) .syncToRight("prop", ifDefined((v) => v.toUpperCase()).else("missing value") ).enable().syncToRightNow();//-> b.prop === "missing value";a.prop = "test"; // -> b.prop === "TEST" Copy
let a = new Clazz();let b = new Clazz();Binding.for(a, b) .syncToRight("prop", ifDefined((v) => v.toUpperCase()).else("missing value") ).enable().syncToRightNow();//-> b.prop === "missing value";a.prop = "test"; // -> b.prop === "TEST"
Builds function which executes a given callback only if value is not undefined or null. The created function will have a "else" method, which can be used to bind default values.