scheduleArray.js 702 B

123456789101112131415161718192021
  1. /** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
  2. import { Observable } from '../Observable';
  3. import { Subscription } from '../Subscription';
  4. export function scheduleArray(input, scheduler) {
  5. return new Observable(function (subscriber) {
  6. var sub = new Subscription();
  7. var i = 0;
  8. sub.add(scheduler.schedule(function () {
  9. if (i === input.length) {
  10. subscriber.complete();
  11. return;
  12. }
  13. subscriber.next(input[i++]);
  14. if (!subscriber.closed) {
  15. sub.add(this.schedule());
  16. }
  17. }));
  18. return sub;
  19. });
  20. }
  21. //# sourceMappingURL=scheduleArray.js.map