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 556B

123456789101112131415161718192021
  1. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  2. var nextHandle = 1;
  3. var tasksByHandle = {};
  4. function runIfPresent(handle) {
  5. var cb = tasksByHandle[handle];
  6. if (cb) {
  7. cb();
  8. }
  9. }
  10. export var Immediate = {
  11. setImmediate: function (cb) {
  12. var handle = nextHandle++;
  13. tasksByHandle[handle] = cb;
  14. Promise.resolve().then(function () { return runIfPresent(handle); });
  15. return handle;
  16. },
  17. clearImmediate: function (handle) {
  18. delete tasksByHandle[handle];
  19. },
  20. };
  21. //# sourceMappingURL=Immediate.js.map