26 lines
589 B
Markdown
26 lines
589 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [timeout](./js-utils.timeout.md)
|
|
|
|
## timeout() function
|
|
|
|
Reject after a set amount of time if the original promise has not yet resolved.
|
|
|
|
<b>Signature:</b>
|
|
|
|
```typescript
|
|
export declare function timeout<T>(ms: number, oper: Promise<T>): Promise<T>;
|
|
```
|
|
|
|
## Parameters
|
|
|
|
| Parameter | Type | Description |
|
|
| --- | --- | --- |
|
|
| ms | number | |
|
|
| oper | Promise<T> | |
|
|
|
|
<b>Returns:</b>
|
|
|
|
Promise<T>
|
|
|