UNPKG

@hirosystems/chainhook-client

Version:
16 lines 522 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.timeout = void 0; function timeout(ms, abortController) { return new Promise((resolve, reject) => { const timeout = setTimeout(() => { resolve(); }, ms); abortController?.signal.addEventListener('abort', () => { clearTimeout(timeout); reject(new Error(`Timeout aborted`)); }, { once: true }); }); } exports.timeout = timeout; //# sourceMappingURL=helpers.js.map