rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
84 lines (39 loc) • 1.09 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [promisePoll](./rc-js-util.promisepoll.md)
## promisePoll() function
**Signature:**
```typescript
export declare function promisePoll(predicate: () => boolean, pollInterval?: number | undefined, maxTicks?: number): INonblockingPoll;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
predicate
</td><td>
() => boolean
</td><td>
Once true, the poll finishes. Exceptions are not supported.
</td></tr>
<tr><td>
pollInterval
</td><td>
number \| undefined
</td><td>
_(Optional)_ In milliseconds, defaults to smallest (probably 4 ms).
</td></tr>
<tr><td>
maxTicks
</td><td>
number
</td><td>
_(Optional)_ The number of times to run the poll before giving up.
</td></tr>
</tbody></table>
**Returns:**
[INonblockingPoll](./rc-js-util.inonblockingpoll.md)