【文件属性】:
文件名称:promise-fncall:可以处理promise参数的Function.call
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-09 15:02:35
JavaScript
承诺电话
可以处理promise参数的Function.call
安装
使用安装promise-fncall :
npm install --save promise-fncall
用法
模块使用
var call = require ( 'promise-fncall' ) ;
function greet ( val ) {
return 'hello ' + val ;
}
call ( greet , Promise . resolve ( 'world' ) )
. then ( function ( val ) {
// val === 'hello world'
} ) ;
原料药
call(fn, ...promises)
名称
类型
描述
fn
`功能
承诺{[功能]}`
...promises
Promise
全部解析后传递给fn的参数
【文件预览】:
promise-fncall-master
----.travis.yml(48B)
----package.json(618B)
----test()
--------test.js(1KB)
----src()
--------index.js(186B)
----.npmignore(6B)
----.gitignore(14B)
----README.md(2KB)
----.editorconfig(231B)