Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix definition of middleware in guide.md #1810

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

dsommerich
Copy link
Contributor

This PR is to fix the definition of what a middleware is in guide.md. The old definition says that middleware are "simple functions which return a MiddlewareFunction", however every other peice of documentation I could find refers to the MiddlewareFunction itself as the middleware (not the function that returns the MiddlewareFunction).

If the old definition is intentional and correct, I'm happy to close this PR, but it really seems like it's not correct. E.g. the very next sentence says "When the middleware is run, it must manually invoke next()", however if a middleware is the function that returns the MiddlewareFunction then it wouldn't be able to invoke next() since next is passed to the MiddlewareFunction not the function that returns the MiddlewareFunction.

Sorry if this is pedantic, we just had a bit of a back-and-forth on this in a PR and I decided to actually be productive and fix it instead of just complaining to coworkers 馃槄.

Checklist

  • I have ensured my pull request is not behind the main or master branch of the original repository.
  • I have rebased all commits where necessary so that reviewing this pull request can be done without having to merge it first.
  • I have written a commit message that passes commitlint linting.
  • I have ensured that my code changes pass linting tests.
  • I have ensured that my code changes pass unit tests.
  • I have described my pull request and the reasons for code changes along with context if necessary.

@fengmk2 fengmk2 merged commit 6fbc40b into koajs:master Apr 22, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants