Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fromArray.js 939B

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