UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

9 lines (7 loc) 190 B
function defer(func, ...args) { if (typeof func !== 'function') { throw new TypeError('Expected a function'); } return setTimeout(func, 1, ...args); } export { defer };