ngx-decorate
Version:
Useful decorators for Angular 2 and above
35 lines • 858 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const symbols_1 = require("../lib/symbols");
/** @internal */
function unsubArray(props) {
for (const sub of props) {
sub.unsubscribe();
}
}
/** @internal */
function processProp(prop) {
if (prop) {
if (Array.isArray(prop)) {
unsubArray(prop);
}
else {
prop.unsubscribe();
}
}
}
/** @internal */
function unsubscribe(self) {
if (self[symbols_1._unsubscribe]) {
for (const prop of self[symbols_1._unsubscribe]) {
processProp(self[prop]);
}
}
if (self[symbols_1._subscrToSubs]) {
for (const prop of self[symbols_1._subscrToSubs]) {
processProp(prop);
}
}
}
exports.unsubscribe = unsubscribe;
//# sourceMappingURL=unsubscribe.js.map