Skip to content

Commit 14cf3e6

Browse files
committed
batch
1 parent 8f4cd39 commit 14cf3e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Default to a dummy "batch" implementation that just runs the callback
2-
function defaultNoopBatch(callback) {
2+
function defaultNoopBatch(callback: () => void) {
33
callback()
44
}
55

66
let batch = defaultNoopBatch
77

88
// Allow injecting another batching function later
9-
export const setBatch = (newBatch) => (batch = newBatch)
9+
export const setBatch = (newBatch: (callback: () => void) => void) => (batch = newBatch)
1010

1111
// Supply a getter just to skip dealing with ESM bindings
1212
export const getBatch = () => batch

0 commit comments

Comments
 (0)