@nxtedition/lib 23.15.7 → 23.16.0
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/package.json +1 -1
- package/yield.js +5 -5
package/package.json
CHANGED
package/yield.js
CHANGED
|
@@ -14,16 +14,16 @@ export function setYieldTimeout(timeout) {
|
|
|
14
14
|
yieldTimeout = timeout
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export function shouldYield() {
|
|
18
|
+
return yieldState > 0 || performance.now() - yieldTime >= yieldTimeout
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
export function maybeYield(callback) {
|
|
18
22
|
if (callback != null && typeof callback !== 'function') {
|
|
19
23
|
throw new TypeError('callback must be a function')
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
return null
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return doYield(callback) ?? true
|
|
26
|
+
return shouldYield() ? (doYield(callback) ?? true) : null
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export function doYield(callback) {
|