Wraps a promise with a timeout. If the promise does not resolve or reject within the specified time, it will be rejected with a ${TIMEOUT_ERROR_MESSAGE} error.
The promise to wrap with a timeout.
Optional
The timeout duration in milliseconds.
import { withTimeout } from "nsuite";const newPromise = withTimeout(promise, 3000); Copy
import { withTimeout } from "nsuite";const newPromise = withTimeout(promise, 3000);
Wraps a promise with a timeout. If the promise does not resolve or reject within the specified time, it will be rejected with a ${TIMEOUT_ERROR_MESSAGE} error.