webiny-compose
This library is used to compose multiple functions into a connect-style middleware with one difference: it is ONLY intended to be used with arbitrary data.
Often we need to create a queue of functions to process an input, and we need to be able to control the flow. Usually we would use a publish/subscribe pattern, but it is not often straightforward and not easily controllable due to the nature of events, propagation, and order of events.
Middleware lets us specify the exact order of execution which is especially useful in configurations where you DO have control over your code.
How to use
; const middleware = ; // Now execute the middlewareconst params = {};;