2020-03-29 13:43:52 +00:00
|
|
|
<!-- 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
|
2020-07-29 13:22:32 +00:00
|
|
|
export declare function timeout<T>(ms: number, oper: Promise<T>): Promise<T>;
|
2020-03-29 13:43:52 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --- | --- | --- |
|
2020-06-29 23:23:16 +00:00
|
|
|
| ms | number | |
|
|
|
|
| oper | Promise<T> | |
|
2020-03-29 13:43:52 +00:00
|
|
|
|
|
|
|
<b>Returns:</b>
|
|
|
|
|
2020-07-29 13:22:32 +00:00
|
|
|
Promise<T>
|
2020-03-29 13:43:52 +00:00
|
|
|
|