Iterates through the functions
and calls them with given the parameters
and returns the first non-empty result.
Example:
const f = dispatch(
(value) => { return value > 5 ? 'Value is greater than 5.' : undefined },
(value) => { return value === 5 ? 'Value is 5.' : undefined },
(value) => { return value < 5 ? 'Value is less than 5.' : undefined }
);
console.log(f(2)); // Value is less then 5.
Iterates through the functions and calls them with given the parameters and returns the first non-empty result.
Example:
const f = dispatch( (value) => { return value > 5 ? 'Value is greater than 5.' : undefined }, (value) => { return value === 5 ? 'Value is 5.' : undefined }, (value) => { return value < 5 ? 'Value is less than 5.' : undefined } ); console.log(f(2)); // Value is less then 5.