mirror of
https://github.com/UofCBaja/BajaUofCWebsite.git
synced 2025-06-15 05:14:18 -06:00
added jsdoc comments to fakeDelay tool
This commit is contained in:
parent
3d0872bd96
commit
09fd161ba2
@ -1,18 +1,12 @@
|
||||
|
||||
/**
|
||||
* @param {int} ms - time in ms to add a delay
|
||||
* @returns {Promise(resolve)} Promise - reutrns an empty promise after the set time
|
||||
* @description Testing tool to delay a function deliberatly
|
||||
* @author Brock <darkicewolf50@gmail.com>
|
||||
* @example await fakeDelay(5000);
|
||||
*/
|
||||
function fakeDelay(ms) {
|
||||
/*
|
||||
useful for testing allows for a fake response, allow us to see what the program does while waiting for data from the backend
|
||||
REQUIRES:
|
||||
time in milliseconds
|
||||
|
||||
needs a line like this to run
|
||||
await fakeDelay(5000);
|
||||
PROMISES:
|
||||
nothing
|
||||
Develop in part by: Brock
|
||||
Contact: darkicewolf50@gmial.com
|
||||
*/
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export default fakeDelay;
|
||||
export default fakeDelay;
|
||||
|
Loading…
x
Reference in New Issue
Block a user