@softchef/cdk-iot-device-management
Version:
IoT device management is composed of things, thing types, thing groups, jobs, files API services. The constructs can be used independently, that are based on full-managed service to create an API Gateway & Lambda function.
13 lines (12 loc) • 458 B
JavaScript
export function requestTimeout(timeoutInMs) {
if (timeoutInMs === void 0) { timeoutInMs = 0; }
return new Promise(function (resolve, reject) {
if (timeoutInMs) {
setTimeout(function () {
var timeoutError = new Error("Request did not complete within " + timeoutInMs + " ms");
timeoutError.name = "TimeoutError";
reject(timeoutError);
}, timeoutInMs);
}
});
}