@nxtedition/scheduler 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -8,5 +8,5 @@ export declare class Scheduler {
8
8
  constructor(opts?: SharedArrayBuffer | {
9
9
  concurrency?: number;
10
10
  });
11
- schedule(fn: (next: Function) => any, priority?: 0 | 1 | 2 | "low" | "normal" | "high"): any;
11
+ schedule(fn: (next: Function) => any, priority?: 0 | 1 | 2 | 'low' | 'normal' | 'high'): any;
12
12
  }
package/lib/index.js CHANGED
@@ -44,7 +44,10 @@ export class Scheduler {
44
44
  }
45
45
  }
46
46
 
47
- schedule(fn , priority = Scheduler.NORMAL) {
47
+ schedule(
48
+ fn ,
49
+ priority = Scheduler.NORMAL,
50
+ ) {
48
51
  if (typeof fn !== 'function') {
49
52
  throw new TypeError('First argument must be a function')
50
53
  }
@@ -104,10 +107,10 @@ export class Scheduler {
104
107
  ? Atomics.add(this.#stateView, Scheduler.#COUNTER_INDEX, 1)
105
108
  : this.#counter++
106
109
  const fn =
107
- ((counter & 63) === 0 && this.#lowQueue.shift()) ??
108
- ((counter & 15) === 0 && this.#normalQueue.shift()) ??
109
- this.#highQueue.shift() ??
110
- this.#normalQueue.shift() ??
110
+ ((counter & 63) === 0 && this.#lowQueue.shift()) ||
111
+ ((counter & 15) === 0 && this.#normalQueue.shift()) ||
112
+ this.#highQueue.shift() ||
113
+ this.#normalQueue.shift() ||
111
114
  this.#lowQueue.shift()
112
115
 
113
116
  running = this.#stateView
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/scheduler",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -20,5 +20,5 @@
20
20
  "rimraf": "^6.1.2",
21
21
  "typescript": "^5.9.3"
22
22
  },
23
- "gitHead": "8a7862ed029e6ec42bbccd925bf638e7b069cc5e"
23
+ "gitHead": "ba7f0417c8dbf2a8d6e38f5848f5e8ec162f4eb7"
24
24
  }