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.
26 lines
777 B
26 lines
777 B
"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
|