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
hook1 before
hook2 before
hook3 before
Hello David
hook3 after
hook2 after
hook1 after
Actual behavior
The output of the script is:
hook2 before
hook1 before
Hello David!
hook1 after
hook2 after
hook3 after
Thoughts
As hooks are decorators, it is clear that the last wrapped hook is run first.
So the question is, if the documentation should be adjusted, or if the order of the array should be reversed for wrapping. So that the first entry is wrapped as last one.
Steps to reproduce
Running the script from the documentation: https://github.com/feathersjs/hooks#middleware
Expected behavior
The output of the script should be (documented):
Actual behavior
The output of the script is:
Thoughts
As hooks are decorators, it is clear that the last wrapped hook is run first.
So the question is, if the documentation should be adjusted, or if the order of the array should be reversed for wrapping. So that the first entry is wrapped as last one.
Brought up in Slack: https://feathersjs.slack.com/archives/C0HJE6A65/p1591009725097800?thread_ts=1590992656.097000&cid=C0HJE6A65
The text was updated successfully, but these errors were encountered: