文件名称:ActionSequence:按顺序处理一系列承诺
文件大小:13KB
文件格式:ZIP
更新时间:2024-05-20 01:09:03
JavaScript
动作序列 具有Promise.all()很棒,但是有时候您只想按固定顺序遍历Promises或函数列表。 ActionSequence在节点和浏览器环境中均可使用。 用法 const ActionSequence = require ( "action-sequence" ) ; const options = { delay : 500 } ; const actions = { action1 : ( { action , delay } ) => new Promise ( resolve => { setTimeout ( ( ) => { resolve ( 1 ) ; } , delay ) ; } ) , action2 : ( { action , delay } ) => new Promise (
【文件预览】:
ActionSequence-master
----.gitignore(914B)
----package.json(628B)
----package-lock.json(31KB)
----LICENSE(1KB)
----index.js(708B)
----README.md(2KB)
----test()
--------spec.js(1KB)
----.editorconfig(295B)