Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ngneat/until-destroy

Package Overview
Dependencies
Maintainers
4
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngneat/until-destroy - npm Package Compare versions

Comparing version 7.1.5 to 7.1.6

51

bundles/ngneat-until-destroy.umd.js

@@ -19,2 +19,4 @@ (function (global, factory) {

var DECORATOR_APPLIED = Symbol('__decoratorApplied');
var NG_COMPONENT_DEF = 'ɵcmp';
var NG_DIRECTIVE_DEF = 'ɵdir';
/**

@@ -35,2 +37,5 @@ * If we use the `untilDestroyed` operator multiple times inside the single

}
function missingDecorator(providerOrDef) {
return !providerOrDef[DECORATOR_APPLIED];
}
function markAsDecorated(providerOrDef) {

@@ -42,4 +47,3 @@ providerOrDef[DECORATOR_APPLIED] = true;

var providerOrDef = isInjectableType(constructor) ? constructor : getDef(constructor);
var missingDecorator = !providerOrDef[DECORATOR_APPLIED];
if (missingDecorator) {
if (missingDecorator(providerOrDef)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +

@@ -68,4 +72,13 @@ 'components or providers that are not decorated with UntilDestroy decorator');

function getDef(type) {
return type.ɵcmp || type.ɵdir;
return (type[NG_COMPONENT_DEF] ||
type[NG_DIRECTIVE_DEF]);
}
function getDefName(type) {
if (type.hasOwnProperty(NG_COMPONENT_DEF)) {
return NG_COMPONENT_DEF;
}
else {
return NG_DIRECTIVE_DEF;
}
}
/**

@@ -116,6 +129,32 @@ * Determines whether the provided `target` is some function

}
/**
* https://github.com/ngneat/until-destroy/issues/78
* Some declared components or directives may be compiled asynchronously in JIT,
* especially those that're lazy-loaded. And thus may have their
* definition not accessible yet.
*/
function decorateDirectiveJIT(type, options) {
var defName = getDefName(type);
var getter = Object.getOwnPropertyDescriptor(type, defName).get;
Object.defineProperty(type, defName, {
get: function () {
var def = getter();
if (missingDecorator(def)) {
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
return def;
}
});
}
function decorateDirective(type, options) {
var def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
var isJIT = type.hasOwnProperty('__annotations__');
if (isJIT) {
decorateDirectiveJIT(type, options);
}
else {
var def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
}

@@ -122,0 +161,0 @@ function UntilDestroy(options) {

2

bundles/ngneat-until-destroy.umd.min.js

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngneat/until-destroy",["exports","rxjs","rxjs/operators"],n):n(((t=t||self).ngneat=t.ngneat||{},t.ngneat["until-destroy"]={}),t.rxjs,t.rxjs.operators)}(this,(function(t,n,r){"use strict";function e(t){return"function"==typeof t}var o=Symbol("__destroy"),i=Symbol("__decoratorApplied");function s(t){return"string"==typeof t?Symbol("__destroy__"+t):o}function u(t){t[i]=!0}function c(t,r){t[r]||(t[r]=new n.Subject)}function f(t,n){t[n]&&(t[n].next(),t[n].complete(),t[n]=null)}function a(t){return t.ɵcmp||t.ɵdir}function p(t){return!!t.ɵprov}function d(t){t&&e(t.unsubscribe)&&t.unsubscribe()}function y(t,n){var r=n.arrayName,e=n.checkProperties,o=n.blackList;return function(){if(t&&t.call(this),f(this,s()),r)return function(t){Array.isArray(t)&&t.forEach(d)}(this[r]);if(e)for(var n in this)o&&o.includes(n)||d(this[n])}}t.UntilDestroy=function(t){return void 0===t&&(t={}),function(n){p(n)?function(t,n){t.prototype.ngOnDestroy=y(t.prototype.ngOnDestroy,n),u(t)}(n,t):function(t,n){var r=a(t);r.onDestroy=y(r.onDestroy,n),u(r)}(n,t)}},t.untilDestroyed=function(t,n){return function(o){var u=s(n);return"string"==typeof n?function(t,n,r){var o=t[n];if(!1===e(o))throw new Error(t.constructor.name+" is using untilDestroyed but doesn't implement "+n);c(t,r),t[n]=function(){e(o)&&o.apply(this,arguments),f(this,r),t[n]=o}}(t,n,u):(!function(t){var n=t.constructor;if(!(p(n)?n:a(n))[i])throw new Error("untilDestroyed operator cannot be used inside directives or components or providers that are not decorated with UntilDestroy decorator")}(t),c(t,u)),o.pipe(r.takeUntil(t[u]))}},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngneat/until-destroy",["exports","rxjs","rxjs/operators"],n):n(((t=t||self).ngneat=t.ngneat||{},t.ngneat["until-destroy"]={}),t.rxjs,t.rxjs.operators)}(this,(function(t,n,r){"use strict";function e(t){return"function"==typeof t}var o=Symbol("__destroy"),i=Symbol("__decoratorApplied");function s(t){return"string"==typeof t?Symbol("__destroy__"+t):o}function u(t){return!t[i]}function c(t){t[i]=!0}function f(t,r){t[r]||(t[r]=new n.Subject)}function a(t,n){t[n]&&(t[n].next(),t[n].complete(),t[n]=null)}function p(t){return t["ɵcmp"]||t["ɵdir"]}function y(t){return!!t.ɵprov}function d(t){t&&e(t.unsubscribe)&&t.unsubscribe()}function l(t,n){var r=n.arrayName,e=n.checkProperties,o=n.blackList;return function(){if(t&&t.call(this),a(this,s()),r)return function(t){Array.isArray(t)&&t.forEach(d)}(this[r]);if(e)for(var n in this)o&&o.includes(n)||d(this[n])}}function h(t,n){if(t.hasOwnProperty("__annotations__"))!function(t,n){var r=function(t){return t.hasOwnProperty("ɵcmp")?"ɵcmp":"ɵdir"}(t),e=Object.getOwnPropertyDescriptor(t,r).get;Object.defineProperty(t,r,{get:function(){var t=e();return u(t)&&(t.onDestroy=l(t.onDestroy,n),c(t)),t}})}(t,n);else{var r=p(t);r.onDestroy=l(r.onDestroy,n),c(r)}}t.UntilDestroy=function(t){return void 0===t&&(t={}),function(n){y(n)?function(t,n){t.prototype.ngOnDestroy=l(t.prototype.ngOnDestroy,n),c(t)}(n,t):h(n,t)}},t.untilDestroyed=function(t,n){return function(o){var i=s(n);return"string"==typeof n?function(t,n,r){var o=t[n];if(!1===e(o))throw new Error(t.constructor.name+" is using untilDestroyed but doesn't implement "+n);f(t,r),t[n]=function(){e(o)&&o.apply(this,arguments),a(this,r),t[n]=o}}(t,n,i):(!function(t){var n=t.constructor;if(u(y(n)?n:p(n)))throw new Error("untilDestroyed operator cannot be used inside directives or components or providers that are not decorated with UntilDestroy decorator")}(t),f(t,i)),o.pipe(r.takeUntil(t[i]))}},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ngneat-until-destroy.umd.min.js.map

@@ -14,2 +14,4 @@ import { Subject } from 'rxjs';

const DECORATOR_APPLIED = Symbol('__decoratorApplied');
const NG_COMPONENT_DEF = 'ɵcmp';
const NG_DIRECTIVE_DEF = 'ɵdir';
/**

@@ -30,2 +32,5 @@ * If we use the `untilDestroyed` operator multiple times inside the single

}
export function missingDecorator(providerOrDef) {
return !providerOrDef[DECORATOR_APPLIED];
}
export function markAsDecorated(providerOrDef) {

@@ -37,4 +42,3 @@ providerOrDef[DECORATOR_APPLIED] = true;

const providerOrDef = isInjectableType(constructor) ? constructor : getDef(constructor);
const missingDecorator = !providerOrDef[DECORATOR_APPLIED];
if (missingDecorator) {
if (missingDecorator(providerOrDef)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +

@@ -63,4 +67,13 @@ 'components or providers that are not decorated with UntilDestroy decorator');

export function getDef(type) {
return type.ɵcmp || type.ɵdir;
return (type[NG_COMPONENT_DEF] ||
type[NG_DIRECTIVE_DEF]);
}
export function getDefName(type) {
if (type.hasOwnProperty(NG_COMPONENT_DEF)) {
return NG_COMPONENT_DEF;
}
else {
return NG_DIRECTIVE_DEF;
}
}
/**

@@ -73,2 +86,2 @@ * Determines whether the provided `target` is some function

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJuYWxzLmpzIiwic291cmNlUm9vdCI6Im5nOi8v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yZWN0aXZlVHlwZTxUPiB8IENvbXBvbmVudFR5cGU8VD5cbik6IERpcmVjdGl2ZURlZjxUPiB8IENvbXBvbmVudERlZjxUPiB7XG4gIHJldHVybiAoXG4gICAgKHR5cGUgYXMgQ29tcG9uZW50VHlwZTxUPilbTkdfQ09NUE9ORU5UX0RFRl0gfHxcbiAgICAodHlwZSBhcyBEaXJlY3RpdmVUeXBlPFQ+KVtOR19ESVJFQ1RJVkVfREVGXVxuICApO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZ2V0RGVmTmFtZTxUPih0eXBlOiBEaXJlY3RpdmVUeXBlPFQ+IHwgQ29tcG9uZW50VHlwZTxUPikge1xuICBpZiAodHlwZS5oYXNPd25Qcm9wZXJ0eShOR19DT01QT05FTlRfREVGKSkge1xuICAgIHJldHVybiBOR19DT01QT05FTlRfREVGO1xuICB9IGVsc2Uge1xuICAgIHJldHVybiBOR19ESVJFQ1RJVkVfREVGO1xuICB9XG59XG5cbi8qKlxuICogRGV0ZXJtaW5lcyB3aGV0aGVyIHRoZSBwcm92aWRlZCBgdGFyZ2V0YCBpcyBzb21lIGZ1bmN0aW9uXG4gKiBkZWNvcmF0ZWQgd2l0aCBgQEluamVjdGFibGUoKWBcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGlzSW5qZWN0YWJsZVR5cGUodGFyZ2V0OiBhbnkpOiB0YXJnZXQgaXMgSW5qZWN0YWJsZVR5cGU8dW5rbm93bj4ge1xuICByZXR1cm4gISF0YXJnZXQuybVwcm92O1xufVxuIl19

@@ -1,2 +0,2 @@

import { getDef, getSymbol, isFunction, completeSubjectOnTheInstance, isInjectableType, markAsDecorated } from './internals';
import { getDef, getSymbol, isFunction, completeSubjectOnTheInstance, isInjectableType, markAsDecorated, missingDecorator, getDefName } from './internals';
function unsubscribe(property) {

@@ -38,6 +38,32 @@ property && isFunction(property.unsubscribe) && property.unsubscribe();

}
/**
* https://github.com/ngneat/until-destroy/issues/78
* Some declared components or directives may be compiled asynchronously in JIT,
* especially those that're lazy-loaded. And thus may have their
* definition not accessible yet.
*/
function decorateDirectiveJIT(type, options) {
const defName = getDefName(type);
const getter = Object.getOwnPropertyDescriptor(type, defName).get;
Object.defineProperty(type, defName, {
get() {
const def = getter();
if (missingDecorator(def)) {
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
return def;
}
});
}
function decorateDirective(type, options) {
const def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
const isJIT = type.hasOwnProperty('__annotations__');
if (isJIT) {
decorateDirectiveJIT(type, options);
}
else {
const def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
}

@@ -54,2 +80,2 @@ export function UntilDestroy(options = {}) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW50aWwtZGVzdHJveS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ25lYXQvdW50aWwtZGVzdHJveS8iLCJzb3VyY2VzIjpbImxpYi91bnRpbC1kZXN0cm95LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1BLE9BQU8sRUFDTCxNQUFNLEVBQ04sU0FBUyxFQUNULFVBQVUsRUFFViw0QkFBNEIsRUFDNUIsZ0JBQWdCLEVBQ2hCLGVBQWUsRUFDaEIsTUFBTSxhQUFhLENBQUM7QUFFckIsU0FBUyxXQUFXLENBQUMsUUFBYTtJQUNoQyxRQUFRLElBQUksVUFBVSxDQUFDLFFBQVEsQ0FBQyxXQUFXLENBQUMsSUFBSSxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUM7QUFDekUsQ0FBQztBQUVELFNBQVMsZ0NBQWdDLENBQUMsUUFBZTtJQUN2RCxLQUFLLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxJQUFJLFFBQVEsQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDM0QsQ0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RGVzdHJveU9wdGlvbnMgPSB7fSk6IENsYXNzRGVjb3JhdG9yIHtcbiAgcmV0dXJuICh0YXJnZXQ6IGFueSkgPT4ge1xuICAgIGlmIChpc0luamVjdGFibGVUeXBlKHRhcmdldCkpIHtcbiAgICAgIGRlY29yYXRlUHJvdmlkZXIodGFyZ2V0LCBvcHRpb25zKTtcbiAgICB9IGVsc2Uge1xuICAgICAgZGVjb3JhdGVEaXJlY3RpdmUodGFyZ2V0LCBvcHRpb25zKTtcbiAgICB9XG4gIH07XG59XG4iXX0=

@@ -14,2 +14,4 @@ import { Subject } from 'rxjs';

var DECORATOR_APPLIED = Symbol('__decoratorApplied');
var NG_COMPONENT_DEF = 'ɵcmp';
var NG_DIRECTIVE_DEF = 'ɵdir';
/**

@@ -30,2 +32,5 @@ * If we use the `untilDestroyed` operator multiple times inside the single

}
export function missingDecorator(providerOrDef) {
return !providerOrDef[DECORATOR_APPLIED];
}
export function markAsDecorated(providerOrDef) {

@@ -37,4 +42,3 @@ providerOrDef[DECORATOR_APPLIED] = true;

var providerOrDef = isInjectableType(constructor) ? constructor : getDef(constructor);
var missingDecorator = !providerOrDef[DECORATOR_APPLIED];
if (missingDecorator) {
if (missingDecorator(providerOrDef)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +

@@ -63,4 +67,13 @@ 'components or providers that are not decorated with UntilDestroy decorator');

export function getDef(type) {
return type.ɵcmp || type.ɵdir;
return (type[NG_COMPONENT_DEF] ||
type[NG_DIRECTIVE_DEF]);
}
export function getDefName(type) {
if (type.hasOwnProperty(NG_COMPONENT_DEF)) {
return NG_COMPONENT_DEF;
}
else {
return NG_DIRECTIVE_DEF;
}
}
/**

@@ -73,2 +86,2 @@ * Determines whether the provided `target` is some function

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJuYWxzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5nbmVhdC91bnRpbC1kZXN0cm95LyIsInNvdXJ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29tcG9uZW50RGVmPFQ+IHtcbiAgcmV0dXJuIChcbiAgICAodHlwZSBhcyBDb21wb25lbnRUeXBlPFQ+KVtOR19DT01QT05FTlRfREVGXSB8fFxuICAgICh0eXBlIGFzIERpcmVjdGl2ZVR5cGU8VD4pW05HX0RJUkVDVElWRV9ERUZdXG4gICk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXREZWZOYW1lPFQ+KHR5cGU6IERpcmVjdGl2ZVR5cGU8VD4gfCBDb21wb25lbnRUeXBlPFQ+KSB7XG4gIGlmICh0eXBlLmhhc093blByb3BlcnR5KE5HX0NPTVBPTkVOVF9ERUYpKSB7XG4gICAgcmV0dXJuIE5HX0NPTVBPTkVOVF9ERUY7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIE5HX0RJUkVDVElWRV9ERUY7XG4gIH1cbn1cblxuLyoqXG4gKiBEZXRlcm1pbmVzIHdoZXRoZXIgdGhlIHByb3ZpZGVkIGB0YXJnZXRgIGlzIHNvbWUgZnVuY3Rpb25cbiAqIGRlY29yYXRlZCB3aXRoIGBASW5qZWN0YWJsZSgpYFxuICovXG5leHBvcnQgZnVuY3Rpb24gaXNJbmplY3RhYmxlVHlwZSh0YXJnZXQ6IGFueSk6IHRhcmdldCBpcyBJbmplY3RhYmxlVHlwZTx1bmtub3duPiB7XG4gIHJldHVybiAhIXRhcmdldC7JtXByb3Y7XG59XG4iXX0=

@@ -1,2 +0,2 @@

import { getDef, getSymbol, isFunction, completeSubjectOnTheInstance, isInjectableType, markAsDecorated } from './internals';
import { getDef, getSymbol, isFunction, completeSubjectOnTheInstance, isInjectableType, markAsDecorated, missingDecorator, getDefName } from './internals';
function unsubscribe(property) {

@@ -39,6 +39,32 @@ property && isFunction(property.unsubscribe) && property.unsubscribe();

}
/**
* https://github.com/ngneat/until-destroy/issues/78
* Some declared components or directives may be compiled asynchronously in JIT,
* especially those that're lazy-loaded. And thus may have their
* definition not accessible yet.
*/
function decorateDirectiveJIT(type, options) {
var defName = getDefName(type);
var getter = Object.getOwnPropertyDescriptor(type, defName).get;
Object.defineProperty(type, defName, {
get: function () {
var def = getter();
if (missingDecorator(def)) {
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
return def;
}
});
}
function decorateDirective(type, options) {
var def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
var isJIT = type.hasOwnProperty('__annotations__');
if (isJIT) {
decorateDirectiveJIT(type, options);
}
else {
var def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
}

@@ -56,2 +82,2 @@ export function UntilDestroy(options) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW50aWwtZGVzdHJveS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ25lYXQvdW50aWwtZGVzdHJveS8iLCJzb3VyY2VzIjpbImxpYi91bnRpbC1kZXN0cm95LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1BLE9BQU8sRUFDTCxNQUFNLEVBQ04sU0FBUyxFQUNULFVBQVUsRUFFViw0QkFBNEIsRUFDNUIsZ0JBQWdCLEVBQ2hCLGVBQWUsRUFDaEIsTUFBTSxhQUFhLENBQUM7QUFFckIsU0FBUyxXQUFXLENBQUMsUUFBYTtJQUNoQyxRQUFRLElBQUksVUFBVSxDQUFDLFFBQVEsQ0FBQyxXQUFXLENBQUMsSUFBSSxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUM7QUFDekUsQ0FBQztBQUVELFNBQVMsZ0NBQWdDLENBQUMsUUFBZTtJQUN2RCxLQUFLLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxJQUFJLFFBQVEsQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDM0QsQ0FBQztBQUVELFNBQVMsbUJBQW1CLENBQzFCLFdBQTRDLEVBQzVDLEVBQThEO1FBQTVEL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95T3B0aW9ucyA9IHt9KTogQ2xhc3NEZWNvcmF0b3Ige1xuICByZXR1cm4gKHRhcmdldDogYW55KSA9PiB7XG4gICAgaWYgKGlzSW5qZWN0YWJsZVR5cGUodGFyZ2V0KSkge1xuICAgICAgZGVjb3JhdGVQcm92aWRlcih0YXJnZXQsIG9wdGlvbnMpO1xuICAgIH0gZWxzZSB7XG4gICAgICBkZWNvcmF0ZURpcmVjdGl2ZSh0YXJnZXQsIG9wdGlvbnMpO1xuICAgIH1cbiAgfTtcbn1cbiJdfQ==

@@ -16,2 +16,4 @@ import { Subject } from 'rxjs';

const DECORATOR_APPLIED = Symbol('__decoratorApplied');
const NG_COMPONENT_DEF = 'ɵcmp';
const NG_DIRECTIVE_DEF = 'ɵdir';
/**

@@ -32,2 +34,5 @@ * If we use the `untilDestroyed` operator multiple times inside the single

}
function missingDecorator(providerOrDef) {
return !providerOrDef[DECORATOR_APPLIED];
}
function markAsDecorated(providerOrDef) {

@@ -39,4 +44,3 @@ providerOrDef[DECORATOR_APPLIED] = true;

const providerOrDef = isInjectableType(constructor) ? constructor : getDef(constructor);
const missingDecorator = !providerOrDef[DECORATOR_APPLIED];
if (missingDecorator) {
if (missingDecorator(providerOrDef)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +

@@ -65,4 +69,13 @@ 'components or providers that are not decorated with UntilDestroy decorator');

function getDef(type) {
return type.ɵcmp || type.ɵdir;
return (type[NG_COMPONENT_DEF] ||
type[NG_DIRECTIVE_DEF]);
}
function getDefName(type) {
if (type.hasOwnProperty(NG_COMPONENT_DEF)) {
return NG_COMPONENT_DEF;
}
else {
return NG_DIRECTIVE_DEF;
}
}
/**

@@ -112,6 +125,32 @@ * Determines whether the provided `target` is some function

}
/**
* https://github.com/ngneat/until-destroy/issues/78
* Some declared components or directives may be compiled asynchronously in JIT,
* especially those that're lazy-loaded. And thus may have their
* definition not accessible yet.
*/
function decorateDirectiveJIT(type, options) {
const defName = getDefName(type);
const getter = Object.getOwnPropertyDescriptor(type, defName).get;
Object.defineProperty(type, defName, {
get() {
const def = getter();
if (missingDecorator(def)) {
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
return def;
}
});
}
function decorateDirective(type, options) {
const def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
const isJIT = type.hasOwnProperty('__annotations__');
if (isJIT) {
decorateDirectiveJIT(type, options);
}
else {
const def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
}

@@ -118,0 +157,0 @@ function UntilDestroy(options = {}) {

@@ -16,2 +16,4 @@ import { Subject } from 'rxjs';

var DECORATOR_APPLIED = Symbol('__decoratorApplied');
var NG_COMPONENT_DEF = 'ɵcmp';
var NG_DIRECTIVE_DEF = 'ɵdir';
/**

@@ -32,2 +34,5 @@ * If we use the `untilDestroyed` operator multiple times inside the single

}
function missingDecorator(providerOrDef) {
return !providerOrDef[DECORATOR_APPLIED];
}
function markAsDecorated(providerOrDef) {

@@ -39,4 +44,3 @@ providerOrDef[DECORATOR_APPLIED] = true;

var providerOrDef = isInjectableType(constructor) ? constructor : getDef(constructor);
var missingDecorator = !providerOrDef[DECORATOR_APPLIED];
if (missingDecorator) {
if (missingDecorator(providerOrDef)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +

@@ -65,4 +69,13 @@ 'components or providers that are not decorated with UntilDestroy decorator');

function getDef(type) {
return type.ɵcmp || type.ɵdir;
return (type[NG_COMPONENT_DEF] ||
type[NG_DIRECTIVE_DEF]);
}
function getDefName(type) {
if (type.hasOwnProperty(NG_COMPONENT_DEF)) {
return NG_COMPONENT_DEF;
}
else {
return NG_DIRECTIVE_DEF;
}
}
/**

@@ -113,6 +126,32 @@ * Determines whether the provided `target` is some function

}
/**
* https://github.com/ngneat/until-destroy/issues/78
* Some declared components or directives may be compiled asynchronously in JIT,
* especially those that're lazy-loaded. And thus may have their
* definition not accessible yet.
*/
function decorateDirectiveJIT(type, options) {
var defName = getDefName(type);
var getter = Object.getOwnPropertyDescriptor(type, defName).get;
Object.defineProperty(type, defName, {
get: function () {
var def = getter();
if (missingDecorator(def)) {
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
return def;
}
});
}
function decorateDirective(type, options) {
var def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
var isJIT = type.hasOwnProperty('__annotations__');
if (isJIT) {
decorateDirectiveJIT(type, options);
}
else {
var def = getDef(type);
def.onDestroy = decorateNgOnDestroy(def.onDestroy, options);
markAsDecorated(def);
}
}

@@ -119,0 +158,0 @@ function UntilDestroy(options) {

@@ -11,2 +11,3 @@ import { InjectableType, ɵComponentType as ComponentType, ɵDirectiveType as DirectiveType, ɵComponentDef as ComponentDef, ɵDirectiveDef as DirectiveDef } from '@angular/core';

export declare function getSymbol<T>(destroyMethodName?: keyof T): symbol;
export declare function missingDecorator(providerOrDef: InjectableType<unknown> | DirectiveDef<unknown> | ComponentDef<unknown>): boolean;
export declare function markAsDecorated(providerOrDef: InjectableType<unknown> | DirectiveDef<unknown> | ComponentDef<unknown>): void;

@@ -26,2 +27,3 @@ export interface UntilDestroyOptions {

export declare function getDef<T>(type: DirectiveType<T> | ComponentType<T>): DirectiveDef<T> | ComponentDef<T>;
export declare function getDefName<T>(type: DirectiveType<T> | ComponentType<T>): "ɵcmp" | "ɵdir";
/**

@@ -28,0 +30,0 @@ * Determines whether the provided `target` is some function

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"UntilDestroy":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":73,"character":9,"module":"./lib/until-destroy"}},"untilDestroyed":{"__symbolic":"function","parameters":["instance","destroyMethodName"],"value":{"__symbolic":"error","message":"Lambda not supported","line":38,"character":9,"module":"./lib/until-destroyed"}}},"origins":{"UntilDestroy":"./lib/until-destroy","untilDestroyed":"./lib/until-destroyed"},"importAs":"@ngneat/until-destroy"}
{"__symbolic":"module","version":4,"metadata":{"UntilDestroy":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":111,"character":9,"module":"./lib/until-destroy"}},"untilDestroyed":{"__symbolic":"function","parameters":["instance","destroyMethodName"],"value":{"__symbolic":"error","message":"Lambda not supported","line":38,"character":9,"module":"./lib/until-destroyed"}}},"origins":{"UntilDestroy":"./lib/until-destroy","untilDestroyed":"./lib/until-destroyed"},"importAs":"@ngneat/until-destroy"}

@@ -5,3 +5,3 @@ {

"description": "RxJS operator that unsubscribes when Angular component is destroyed",
"version": "7.1.5",
"version": "7.1.6",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc