batch.js 549 B

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