MCPcopy Create free account
hub / github.com/api3dao/airnode / setMaxPromiseTimeout

Function setMaxPromiseTimeout

packages/airnode-examples/src/utils.ts:100–101  ·  view source on GitHub ↗
(promise: Promise<T>, timeoutMs: number)

Source from the content-addressed store, hash-verified

98 });
99
100export const setMaxPromiseTimeout = <T>(promise: Promise<T>, timeoutMs: number): Promise<T> =>
101 Promise.race([promise, new Promise<never>((_, reject) => setTimeout(() => reject('Timeout exceeded!'), timeoutMs))]);
102
103/**
104 * @param networkName The network name as listed in airnode-protocol/deployments

Callers 3

utils.test.tsFile · 0.90
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected