Skip to content

Commit

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

return Promise.resolve()
}

0 comments on commit e8b7177

Please sign in to comment.