Methods
# static delay(ms) → {Promise}
function to create a promise that resolves after a given amount of time
Parameters:
| Name | Type | Description |
|---|---|---|
ms |
int
|
time to wait in ms |
promise that resolves after ms milliseconds
Promise
Example
import { delay } from "nan-design-system/utils";
function walk(){
takeStep()
await delay(1000); // wait 1 second
takeStep()
}