blakeembrey / blakeembrey/compose-middleware
using `compose` for returning 3 and 4 arity middlewares
- Dominant language
- TypeScript
- Stars
- 90
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Hi @blakeembrey
I find your package and it's just what I was looking for. I really like this package because it can helps to split my middlewares into little pieces and compose them. My congrats!
However I would like to understand why is `errors` function needed. I think it's possible to have just one `compose` function:
- If the first middleware has less than 4 arguments, then it returns a 3-arity middleware.
- If the first middleware has 4 arguments, then it returns a 4-arity middleware.
I'm basing this proposal on that usual composition returns a function with the same arity than first called function.
What do you think?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.