26 lines
611 B
Markdown
26 lines
611 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 | <code>number</code> | |
|
||
|
| oper | <code>Promise<T></code> | |
|
||
|
|
||
|
<b>Returns:</b>
|
||
|
|
||
|
`Promise<T>`
|
||
|
|