Skip to content

Commit

Permalink
🐎 don't return a Promise when it's not time to yield
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Jan 5, 2024
1 parent 47c1701 commit 0bbbb9d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/yieldOrContinue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ import SchedulingPriority from './SchedulingPriority'
// eslint-disable-next-line @typescript-eslint/promise-function-async
export default function yieldOrContinue(
priority: SchedulingPriority = 'user-visible',
): Promise<void> {
): Promise<void> | void {
if (isTimeToYield(priority)) {
return yieldControl(priority)
}

return Promise.resolve()
}

0 comments on commit 0bbbb9d

Please sign in to comment.