batch.js 495 B

1234567891011121314151617181920
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.getBatch = exports.setBatch = void 0;
  4. // Default to a dummy "batch" implementation that just runs the callback
  5. function defaultNoopBatch(callback) {
  6. callback();
  7. }
  8. let batch = defaultNoopBatch; // Allow injecting another batching function later
  9. const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings
  10. exports.setBatch = setBatch;
  11. const getBatch = () => batch;
  12. exports.getBatch = getBatch;