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.

subscribeToIterable.js 866B

123456789101112131415161718192021222324252627
  1. /** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
  2. import { iterator as Symbol_iterator } from '../symbol/iterator';
  3. export var subscribeToIterable = function (iterable) {
  4. return function (subscriber) {
  5. var iterator = iterable[Symbol_iterator]();
  6. do {
  7. var item = iterator.next();
  8. if (item.done) {
  9. subscriber.complete();
  10. break;
  11. }
  12. subscriber.next(item.value);
  13. if (subscriber.closed) {
  14. break;
  15. }
  16. } while (true);
  17. if (typeof iterator.return === 'function') {
  18. subscriber.add(function () {
  19. if (iterator.return) {
  20. iterator.return();
  21. }
  22. });
  23. }
  24. return subscriber;
  25. };
  26. };
  27. //# sourceMappingURL=subscribeToIterable.js.map