com-tools
Version:
com-tools 提供了一些通用的工具函数;
62 lines (34 loc) • 1.65 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [com-tools](./com-tools.md) > [multipleLoop](./com-tools.multipleloop.md)
## multipleLoop() function
multipleLoop(option)=<!-- -->> stopLoop() 多次遍历、分批循环;可以把一个大遍历分成若干个小遍历来完成;
**Signature:**
```typescript
export function multipleLoop<StopInfo,ThisValue>(mLoopOpts:{
loopCall:(this:ThisValue,index:number,stepCount:number,total:number)=>StopInfo,
complete ?: (this:ThisValue,stopInfo:StopInfo,index:number,stepCount:number,total:number)=>void,
stepComplete ?: (this:ThisValue,index:number,stepCount:number,total:number)=>StopInfo,
thisValue?:ThisValue,
total?:number,
step?:number,
delay?:number
}):(stopInfo?:StopInfo)=>void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
mLoopOpts
</td><td>
{ loopCall:(this:ThisValue,index:number,stepCount:number,total:number)=>StopInfo, complete ?: (this:ThisValue,stopInfo:StopInfo,index:number,stepCount:number,total:number)=>void, stepComplete ?: (this:ThisValue,index:number,stepCount:number,total:number)=>StopInfo, thisValue?:ThisValue, total?:number, step?:number, delay?:number }
</td><td>
</td></tr>
</tbody></table>
**Returns:**
(stopInfo?:StopInfo)=>void
stopLoop : (stopInfo)=<!-- -->><!-- -->Void 停止循环的函数;调用该函数,会终止正在进行的循环; 入参 stopInfo : any 停止循环的相关信息