Front end of the Slack clone application.

AsapScheduler.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /** PURE_IMPORTS_START ._AsyncScheduler PURE_IMPORTS_END */
  2. var __extends = (this && this.__extends) || function (d, b) {
  3. for (var p in b)
  4. if (b.hasOwnProperty(p))
  5. d[p] = b[p];
  6. function __() { this.constructor = d; }
  7. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8. };
  9. import { AsyncScheduler } from './AsyncScheduler';
  10. export var AsapScheduler = /*@__PURE__*/ (/*@__PURE__*/ function (_super) {
  11. __extends(AsapScheduler, _super);
  12. function AsapScheduler() {
  13. _super.apply(this, arguments);
  14. }
  15. AsapScheduler.prototype.flush = function (action) {
  16. this.active = true;
  17. this.scheduled = undefined;
  18. var actions = this.actions;
  19. var error;
  20. var index = -1;
  21. var count = actions.length;
  22. action = action || actions.shift();
  23. do {
  24. if (error = action.execute(action.state, action.delay)) {
  25. break;
  26. }
  27. } while (++index < count && (action = actions.shift()));
  28. this.active = false;
  29. if (error) {
  30. while (++index < count && (action = actions.shift())) {
  31. action.unsubscribe();
  32. }
  33. throw error;
  34. }
  35. };
  36. return AsapScheduler;
  37. }(AsyncScheduler));
  38. //# sourceMappingURL=AsapScheduler.js.map