diff --git a/client/src/util/misc.tsx b/client/src/util/misc.tsx index 8b77fb79..56bcea29 100644 --- a/client/src/util/misc.tsx +++ b/client/src/util/misc.tsx @@ -188,10 +188,13 @@ export const getByTag = ( /* Async utilities */ -/** Make Promise sync +/** "Make Promise sync". * - * PROMISE EXECUTION STILL HAPPENS ASYNCRONOUSELY! - * But potential errors are catched. + * PROMISE EXECUTION STILL HAPPENS ASYNCRONOUSELY, but catches potential errors! + * + * @example The following two statements are equivalent + * syncify(p); + * p.catch((err) => { throw err; }); */ export const syncify = (promise: Promise): void => { promise.catch((err) => { @@ -199,10 +202,17 @@ export const syncify = (promise: Promise): void => { }); }; -/** "Make async funciton sync" +/** "Make async funciton sync". + * + * Potential errors are catched, but FUNCTION CALL STILL HAPPENS ASYNCRONOUSELY! + * + * @example The following two expressions are equivalent + * syncifyF(f) + * (...args) => { f(...args).catch((err) => {throw err;}); } * - * FUNCTION CALL STILL HAPPENS ASYNCRONOUSELY! - * But potential errors are catched. + * @example Example usage + * async function handleClick() {...} + * const button =