flex-value
Strongly-typed, value-resolution handler:
- From a direct value
- From value as a promise
- From a callback that returns the value
- From a callback that returns a promise
With support for generic error handling.
See Wiki for documentation and examples.
Install
npm i flex-value
Usage
; // fully-dynamic input/value:; // string | Promise<string> | (() => string | Promise<string>) // strongly-typed, actual value resolution:;
And we can handle all types of errors in a generic way:
; ;