Skip to content

Commit

Permalink
feat(esl-utils): add promisifyNextRender common utility
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed May 18, 2023
1 parent b31599a commit 3a93887
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/esl-utils/async/raf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ export const rafDecorator = <T extends AnyToVoidFnSignature>(fn: T): T => {
lastArgs = args;
} as T;
};

/** @returns promise that will be resolved after next render */
export const promisifyNextRender = (): Promise<void> => new Promise((resolve) => afterNextRender(resolve));

0 comments on commit 3a93887

Please # to comment.