Add before and after hooks to store middleware#173
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.
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