batch.js 359 B

12345678910
  1. // Default to a dummy "batch" implementation that just runs the callback
  2. function defaultNoopBatch(callback) {
  3. callback();
  4. }
  5. let batch = defaultNoopBatch; // Allow injecting another batching function later
  6. export const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings
  7. export const getBatch = () => batch;