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
memoizeOne seems not to throw errors when the function call is memoized.
For example, in the function below I would expect the second call to throwingDivide to throw an error, but it does not. Is this behavior expected?
varmemoizeOne=require("memoize-one")function_throwingDivide(x,y){if(y===0){throwError('cannot divide by zero')}returnx/y}constthrowingDivide=memoizeOne(_throwingDivide)try{throwingDivide(4,0)}catch(error){console.log(error)}console.log(throwingDivide(4,0))// does not throw !
Thanks for this library—love it's simplicity!
The text was updated successfully, but these errors were encountered:
memoizeOne seems not to throw errors when the function call is memoized.
For example, in the function below I would expect the second call to
throwingDivide
to throw an error, but it does not. Is this behavior expected?Thanks for this library—love it's simplicity!
The text was updated successfully, but these errors were encountered: