Skip to content

Commit

Permalink
♻️ task.priority → task.strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Jan 17, 2024
1 parent 9791ed5 commit 71302e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tasks/ScheduledTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SchedulingStrategy from '../SchedulingStrategy'
import { PromiseWithResolvers } from '../utils/withResolvers'

type ScheduledTask = PromiseWithResolvers & {
priority: SchedulingStrategy
strategy: SchedulingStrategy
}

export default ScheduledTask
4 changes: 2 additions & 2 deletions src/tasks/createTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export default function createTask(priority: SchedulingStrategy): ScheduledTask
? 0
: priority === 'smooth'
? schedulingState.tasks.findIndex(
(task) => task.priority === 'smooth' || task.priority === 'idle',
(task) => task.strategy === 'smooth' || task.strategy === 'idle',
)
: schedulingState.tasks.findIndex((task) => task.priority === 'idle')
: schedulingState.tasks.findIndex((task) => task.strategy === 'idle')

if (insertIndex === -1) {
schedulingState.tasks.push(item)

Check failure on line 23 in src/tasks/createTask.ts

View workflow job for this annotation

GitHub Actions / Node.js 18

Argument of type '{ priority: SchedulingStrategy; promise: Promise<void>; resolve: (value: void) => void; reject: (reason?: any) => void; }' is not assignable to parameter of type 'ScheduledTask'.

Check failure on line 23 in src/tasks/createTask.ts

View workflow job for this annotation

GitHub Actions / Node.js 20

Argument of type '{ priority: SchedulingStrategy; promise: Promise<void>; resolve: (value: void) => void; reject: (reason?: any) => void; }' is not assignable to parameter of type 'ScheduledTask'.
Expand Down

0 comments on commit 71302e7

Please sign in to comment.