Skip to content

Commit 35df67b

Browse files
fix(non-blocking-json): actually check if it is running DOH
1 parent 5a9ffc6 commit 35df67b

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

packages/node_modules/non-blocking-json/src/index.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ const batch = (() => {
2222
let isRunning = false
2323
function run() {
2424
let tickLength = 0
25-
while (currentLength && tickLength < BATCH_LENGTH) {
26-
const queueItem = queue.shift()
27-
queueItem.cb()
28-
tickLength += queueItem.length
29-
currentLength -= queueItem.length
30-
}
25+
isRunning = true
26+
tick(() => {
3127

32-
if (queue.length) {
33-
tick(run)
34-
}
28+
while (currentLength && tickLength < BATCH_LENGTH) {
29+
const queueItem = queue.shift()
30+
queueItem.cb()
31+
tickLength += queueItem.length
32+
currentLength -= queueItem.length
33+
}
34+
35+
if (queue.length) {
36+
run()
37+
} else {
38+
isRunning = false
39+
}
40+
})
3541
}
3642

3743
return (length, cb) => {

packages/node_modules/overmind-devtools-client/src/BackendConnector.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { parse, tweak } from 'non-blocking-json'
2+
13
import { AppMessage } from './overmind/types'
2-
import { parse } from 'non-blocking-json'
4+
5+
tweak(3000, false)
36

47
type Message = {
58
appName: string

0 commit comments

Comments
 (0)