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
I'm submitting the basic idea here and once you approve it, I'll add the PR with types and tests et al.
The current every and some hooks run the input hooks in parallel, but the problem with that approach is that we can't take advantage of short-circuiting.
For example, if we want to make sure the user is:
is authenticated
AND has access to the resource
Using the existing every hook, both checks will run for every request.
But if we had a everySeq hook for example, if the user is not authenticated, we can run the first check only and directly return an error.
Of course, for a small example like this, it wouldn't make much difference. But sometimes, one of the checks could be resource-intensive and we'd would want to live it till the end to avoid running for most requests.
What do you think ?
The text was updated successfully, but these errors were encountered:
Hello guys,
I'm submitting the basic idea here and once you approve it, I'll add the PR with types and tests et al.
The current
every
andsome
hooks run the input hooks in parallel, but the problem with that approach is that we can't take advantage of short-circuiting.For example, if we want to make sure the user is:
Using the existing
every
hook, both checks will run for every request.But if we had a
everySeq
hook for example, if the user is not authenticated, we can run the first check only and directly return an error.Of course, for a small example like this, it wouldn't make much difference. But sometimes, one of the checks could be resource-intensive and we'd would want to live it till the end to avoid running for most requests.
What do you think ?
The text was updated successfully, but these errors were encountered: