Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
14
Frontend-Learner/node_modules/unicorn-magic/default.js
generated
vendored
Normal file
14
Frontend-Learner/node_modules/unicorn-magic/default.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
export async function delay({seconds, milliseconds} = {}) {
|
||||
let duration;
|
||||
if (typeof seconds === 'number') {
|
||||
duration = seconds * 1000;
|
||||
} else if (typeof milliseconds === 'number') {
|
||||
duration = milliseconds;
|
||||
} else {
|
||||
throw new TypeError('Expected an object with either `seconds` or `milliseconds`.');
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, duration);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue