source: node_modules/es-toolkit/dist/compat/function/delay.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 264 bytes
Line 
1import { toNumber } from '../util/toNumber.mjs';
2
3function delay(func, wait, ...args) {
4 if (typeof func !== 'function') {
5 throw new TypeError('Expected a function');
6 }
7 return setTimeout(func, toNumber(wait) || 0, ...args);
8}
9
10export { delay };
Note: See TracBrowser for help on using the repository browser.