core icon indicating copy to clipboard operation
core copied to clipboard

Zonejs Integration

Open etsuo opened this issue 9 years ago • 1 comments

Each request should be it's own zone context. This will allow for shared state through a request... for example a DB handling function that doesn't have access to express.Request would still have access to the current zone context for the purpose of exchange data across that request.

... https://expressjs.com/en/4x/api.html#res.locals The advantage of using zones is that we won't have to pass around a reference to res.locals in functions that otherwise wouldn't have access to that.

See:

  • https://medium.com/@amcdnl/zones-for-nodejs-apis-670281ac5aa5
  • nodejs/CTC#4

etsuo avatar Apr 19 '17 18:04 etsuo

I'm developing doubts that this should be a core implementation... If someone really wants Zonejs they could inject it in their own middleware early on, so it may not make sense to burden all users with this as many may not find it desirable.

etsuo avatar Feb 08 '18 01:02 etsuo