You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since box can emit unlimited amount of messages, a plain Koa-like middleware won't cut it. We can use generators though and yield to the middleware. The user-level API may look like this:
functionmyFancyMiddleware(ctx,next){// do something before the box is calledfor(letmessageofnext()){// do something with message// pass the message up the middleware chainyieldmessage}// do something once the box is done}
Activity
jnv commentedon Jan 21, 2019
Since box can emit unlimited amount of messages, a plain Koa-like middleware won't cut it. We can use generators though and yield to the middleware. The user-level API may look like this:
jnv commentedon Jan 21, 2019
Prototype here https://github.com/jnv/bakeryjs-middlewares-prototype