scheduleArray.js 540 B

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