Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

scheduleArray.js 626B

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