-
Notifications
You must be signed in to change notification settings - Fork 76
Add before and after hooks to store middleware #173
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Some general thoughts:
|
Would something like providing an object for middleware with Make sense to you? I tried for an API where each middleware was run before and after, by receiving the payload and passing it to a |
could we have the middleware itself return the |
af69dc6 to
3b0edb9
Compare
|
I've made updates to address all your feedback. Middleware now returns an object with optional
Instead of exposing the decorator it's just used internally and all the public facing APIs expect |
|
@maier49 apologies for the late review on this. this looks really good to me, I just have one question on the ordering of the |
agubler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super! Approved pending Matt's question!
|
@matt-gadd The thought process for the order is borrowed from some request hooks as the last interceptor that modifies the request might need to be the first to handle the response, for example for encrypting/decrypting. However, that doesn't really apply the same way to store processes, so I could be convinced either way on the ordering. |
|
@maier49 I leaning towards the const myProcess = createProcess('example', [ command ], [ afterOne, afterTwo ]); |
|
@agubler That's updated now |
**Type:**feature
The following has been addressed in the PR:
prettieras per the readme code style guidelinesDescription:
Adds the concept of "initializers" that can perform sync/async setup before a process is run.
Resolves #90