mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
Update frontend/src/ts/utils/misc.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
b32693926d
commit
e6ff6c50d3
1 changed files with 1 additions and 0 deletions
|
|
@ -598,6 +598,7 @@ export function applyReducedMotion(animationTime: number): number {
|
|||
* Creates a promise with resolvers.
|
||||
* This is useful for creating a promise that can be resolved or rejected from outside the promise itself.
|
||||
* The returned promise reference stays constant even after reset() - it will always await the current internal promise.
|
||||
* Note: Promise chains created via .then()/.catch()/.finally() will always follow the current internal promise state, even if created before reset().
|
||||
*/
|
||||
export function promiseWithResolvers<T = void>(): {
|
||||
resolve: (value: T) => void;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue