Open puzpuzpuz opened 5 years ago
These methods should be included into the documentation (and thus, included into public API) as there are some use cases when ns.run()/.runAndReturn()/.bind() are not an option.
ns.run()/.runAndReturn()/.bind()
Namely, ns.enter()/.exit() methods are very helpful in case of generators. See here for an example: https://github.com/puzpuzpuz/cls-rtracer/blob/master/index.js#L76
ns.enter()/.exit()
Wow, @puzpuzpuz, that was the exact usecase (Koa V1 middleware) I was trying to implement. Thanks!
@jrnail23 no problem at all. Glad that this information was helpful.
These methods should be included into the documentation (and thus, included into public API) as there are some use cases when
ns.run()/.runAndReturn()/.bind()
are not an option.Namely,
ns.enter()/.exit()
methods are very helpful in case of generators. See here for an example: https://github.com/puzpuzpuz/cls-rtracer/blob/master/index.js#L76