thunks 被淘汰了吗?
发布于 6 年前 作者 MiYogurt 2690 次浏览 来自 问答

我只知道 chunk 是 callback 之后 yield + chunk + co 时期的产物。 https://github.com/thunks/thunks

内部是基于 var nextTick = typeof setImmediate === 'function' ? setImmediate : function (fn) { Promise.resolve().then(fn) } 的异步。

感觉 .then 就是 chunk 直接调用。

https://github.com/toajs/toa 对于 chunk 封装的 toa 怎么看?单向的,也就是不存在 next 的回退。认可这种方式么?有啥优势。

1 回复

没用过这两个。。。只用过async和koa。。。

来自✨ Node.js Web框架精选

回到顶部