This feature is experimental. Please share your experiences so we know what to keep or change.
If the given value
is a function, calls the function with the given args
.
Otherwise it just returns value
.
up.util.evalOption(5) // => 5
let fn = () => 1 + 2
up.util.evalOption(fn) // => 3