You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throwing errors may be useful if one is targeting to build end-user applications, but for developing middleware it would be very cumbersome to juggle the flow around the exceptions.
It would be great if the error throwing could be replaced with normal function returns, and let the caller decide to throw or not. Debugging becomes easy for developers and goes easy on CPU too (not to mention the readability of examples improve a lot #59 )
Its impossible to write below kind of simple code, very useful for pedagogic reasons, when errors are thrown liberally.
console.log("validation Result for AAA: ", cc.validateFulfillment(fulfillment1, condition));
console.log("validation Result for BBB: ", cc.validateFulfillment(fulfillment2, condition));
Not to mention, trying to validate an array of fulfillments in for loop or Array map or piping with lodash primitives!!
results = fulfillmentsArray.map(f => cc.validateFulfillment(f, condition);
_.some(results, result => { return result == true });
The returned result value could be object (instead of plain boolean value), if required.
_.some(results, result => { return result.fulfilled == true });
The text was updated successfully, but these errors were encountered:
Throwing errors may be useful if one is targeting to build end-user applications, but for developing middleware it would be very cumbersome to juggle the flow around the exceptions.
It would be great if the error throwing could be replaced with normal function returns, and let the caller decide to throw or not. Debugging becomes easy for developers and goes easy on CPU too (not to mention the readability of examples improve a lot #59 )
Its impossible to write below kind of simple code, very useful for pedagogic reasons, when errors are thrown liberally.
Not to mention, trying to validate an array of fulfillments in for loop or Array map or piping with lodash primitives!!
The returned result value could be object (instead of plain boolean value), if required.
The text was updated successfully, but these errors were encountered: