【文件属性】:
文件名称:insistence:坚持运行回调,并且仅在结果为真时才解析promise
文件大小:30KB
文件格式:ZIP
更新时间:2021-05-26 03:39:40
async retry insistence JavaScript
@bitty/insistence
始终执行回调,并且仅在结果为true时才解决promise。
安装
使用NPM或Yarn安装。
# Using NPM
npm install @bitty/insistence --save
# Using Yarn
yarn add @bitty/insistence
在unpkg上还有一个UMD版本。
< script src =" https://unpkg.com/@bitty/insistence " > </ script >
用法
import insistence from 'insistence'
insistence ( ( ) => window . readyState === 'complete' )
. then ( ( ) => {
// It's only resolved when windo
【文件预览】:
insistence-master
----.gitignore(556B)
----package.json(2KB)
----src()
--------insistence.ts(1KB)
----LICENSE(1KB)
----tsconfig.json(128B)
----rollup.config.js(969B)
----README.md(764B)
----tsconfig.build.json(167B)
----.gitattributes(296B)
----pnpm-lock.yaml(64KB)
----test()
--------index.js(1KB)