• 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.

    Parameters

    Returns TransformerWithElse

    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"