We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f4cd39 commit 14cf3e6Copy full SHA for 14cf3e6
src/utils/batch.js renamed to src/utils/batch.ts
@@ -1,12 +1,12 @@
1
// Default to a dummy "batch" implementation that just runs the callback
2
-function defaultNoopBatch(callback) {
+function defaultNoopBatch(callback: () => void) {
3
callback()
4
}
5
6
let batch = defaultNoopBatch
7
8
// Allow injecting another batching function later
9
-export const setBatch = (newBatch) => (batch = newBatch)
+export const setBatch = (newBatch: (callback: () => void) => void) => (batch = newBatch)
10
11
// Supply a getter just to skip dealing with ESM bindings
12
export const getBatch = () => batch
0 commit comments