This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/rxjs/internal/util/subscribeToIterable.js
2019-08-11 20:48:02 +02:00

26 lines
No EOL
777 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var iterator_1 = require("../symbol/iterator");
exports.subscribeToIterable = function (iterable) { return function (subscriber) {
var iterator = iterable[iterator_1.iterator]();
do {
var item = iterator.next();
if (item.done) {
subscriber.complete();
break;
}
subscriber.next(item.value);
if (subscriber.closed) {
break;
}
} while (true);
if (typeof iterator.return === 'function') {
subscriber.add(function () {
if (iterator.return) {
iterator.return();
}
});
}
return subscriber;
}; };
//# sourceMappingURL=subscribeToIterable.js.map