scheduleArray.js 695 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.scheduleArray = void 0;
  4. var Observable_1 = require("../Observable");
  5. function scheduleArray(input, scheduler) {
  6. return new Observable_1.Observable(function (subscriber) {
  7. var i = 0;
  8. return scheduler.schedule(function () {
  9. if (i === input.length) {
  10. subscriber.complete();
  11. }
  12. else {
  13. subscriber.next(input[i++]);
  14. if (!subscriber.closed) {
  15. this.schedule();
  16. }
  17. }
  18. });
  19. });
  20. }
  21. exports.scheduleArray = scheduleArray;
  22. //# sourceMappingURL=scheduleArray.js.map