thunk2promise:将thunk转换或转换为Bluebird Promise,就像在co @ 4中一样

时间:2021-05-25 10:18:56
【文件属性】:
文件名称:thunk2promise:将thunk转换或转换为Bluebird Promise,就像在co @ 4中一样
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-25 10:18:56
JavaScript thunk2promise 将thunk转换或转换为Bluebird Promise。 安装 npm i thunk2promise --save npm test 用法 有关更多用例,请参见 var thunk2promise = require ( 'thunk2promise' ) function thunk ( a , b ) { return function ( cb ) { if ( a === b ) { return cb ( new Error ( 'a === b' ) ) } cb ( null , a , b , 3 ) } } thunk2promise ( thunk ( 333 , 333 ) ) . catch ( function ( err ) { console . error ( err .
【文件预览】:
thunk2promise-master
----test.js(1KB)
----CONTRIBUTING.md(1KB)
----.travis.yml(347B)
----LICENSE.md(1KB)
----README.md(3KB)
----.editorconfig(397B)
----.gitignore(617B)
----index.js(718B)
----CHANGELOG.md(39B)
----package.json(502B)

网友评论