Preview of the code context widget
export const timeoutMs = 5000;
export function withTimeout<T>(promise: Promise<T>): Promise<T> {
return Promise.race([
promise,
new Promise<T>((_, reject) =>
setTimeout(() => reject(new Error("Timeout")), timeoutMs)
),
]);
}Choose an action and submit to continue the workflow.
This is a preview. Click the button to see what would be sent to your webhook.
Preview of the code context widget
export const timeoutMs = 5000;
export function withTimeout<T>(promise: Promise<T>): Promise<T> {
return Promise.race([
promise,
new Promise<T>((_, reject) =>
setTimeout(() => reject(new Error("Timeout")), timeoutMs)
),
]);
}Choose an action and submit to continue the workflow.
This is a preview. Click the button to see what would be sent to your webhook.