UNPKG

@ermitsrl/bluetooth-le

Version:

Capacitor plugin for Bluetooth Low Energy

10 lines 315 B
export async function runWithTimeout(promise, time, exception) { let timer; return Promise.race([ promise, new Promise((_, reject) => { timer = setTimeout(() => reject(exception), time); }), ]).finally(() => clearTimeout(timer)); } //# sourceMappingURL=timeout.js.map