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 1011B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var Observable_1 = require("../Observable");
  4. var Subscription_1 = require("../Subscription");
  5. var subscribeToArray_1 = require("../util/subscribeToArray");
  6. function fromArray(input, scheduler) {
  7. if (!scheduler) {
  8. return new Observable_1.Observable(subscribeToArray_1.subscribeToArray(input));
  9. }
  10. else {
  11. return new Observable_1.Observable(function (subscriber) {
  12. var sub = new Subscription_1.Subscription();
  13. var i = 0;
  14. sub.add(scheduler.schedule(function () {
  15. if (i === input.length) {
  16. subscriber.complete();
  17. return;
  18. }
  19. subscriber.next(input[i++]);
  20. if (!subscriber.closed) {
  21. sub.add(this.schedule());
  22. }
  23. }));
  24. return sub;
  25. });
  26. }
  27. }
  28. exports.fromArray = fromArray;
  29. //# sourceMappingURL=fromArray.js.map