【文件属性】:
文件名称:promise-filter:过滤数组并返回Promise
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-22 04:43:13
JavaScript
诺言过滤器
数组并返回 。
安装
$ npm install promise-filter
用法
const filter = require ( 'promise-filter' )
Promise . resolve ( [ 1 , 2 , 3 ] )
. then ( filter ( ( val ) => val >= 2 ) )
// => [2, 3]
为什么?
这个模块基本上等效于 ,但是拥有您需要的一个功能而不是厨房水槽很方便。 模块化! 如果您要投放到浏览器,并且需要减小JavaScript包的大小,则特别方便。
使用在浏览器中很好用!
也可以看看
减少承诺
有前途的
执照
麻省理工学院
【文件预览】:
promise-filter-master
----.travis.yml(164B)
----.eslintrc(809B)
----index.js(395B)
----test.js(559B)
----package.json(713B)
----LICENSE(1KB)
----.gitignore(164B)
----README.md(2KB)
----.editorconfig(207B)