Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Immediate.js 586B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var nextHandle = 1;
  4. var tasksByHandle = {};
  5. function runIfPresent(handle) {
  6. var cb = tasksByHandle[handle];
  7. if (cb) {
  8. cb();
  9. }
  10. }
  11. exports.Immediate = {
  12. setImmediate: function (cb) {
  13. var handle = nextHandle++;
  14. tasksByHandle[handle] = cb;
  15. Promise.resolve().then(function () { return runIfPresent(handle); });
  16. return handle;
  17. },
  18. clearImmediate: function (handle) {
  19. delete tasksByHandle[handle];
  20. },
  21. };
  22. //# sourceMappingURL=Immediate.js.map