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 8.0.3 to 8.0.4

23

bundles/ngneat-until-destroy.umd.js

@@ -44,8 +44,2 @@ (function (global, factory) {

}
function ensureClassIsDecorated(instance) {
if (missingDecorator(instance.constructor)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +
'components or providers that are not decorated with UntilDestroy decorator');
}
}
function createSubjectOnTheInstance(instance, symbol) {

@@ -65,5 +59,2 @@ if (!instance[symbol]) {

}
function missingDecorator(type) {
return !(DECORATOR_APPLIED in type.prototype);
}

@@ -121,3 +112,3 @@ function unsubscribe(property) {

var originalDestroy = instance[destroyMethodName];
if (isFunction(originalDestroy) === false) {
if (ngDevMode && isFunction(originalDestroy) === false) {
throw new Error(instance.constructor.name + " is using untilDestroyed but doesn't implement " + destroyMethodName);

@@ -127,3 +118,3 @@ }

instance[destroyMethodName] = function () {
isFunction(originalDestroy) && originalDestroy.apply(this, arguments);
originalDestroy.apply(this, arguments);
completeSubjectOnTheInstance(this, symbol);

@@ -146,3 +137,3 @@ // We have to re-assign this property back to the original value.

else {
ensureClassIsDecorated(instance);
ngDevMode && ensureClassIsDecorated(instance);
createSubjectOnTheInstance(instance, symbol);

@@ -153,2 +144,10 @@ }

}
function ensureClassIsDecorated(instance) {
var prototype = Object.getPrototypeOf(instance);
var missingDecorator = !(DECORATOR_APPLIED in prototype);
if (missingDecorator) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +
'components or providers that are not decorated with UntilDestroy decorator');
}
}

@@ -155,0 +154,0 @@ /**

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

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

@@ -13,3 +13,3 @@ import { Subject } from 'rxjs';

*/
const DECORATOR_APPLIED = Symbol('__decoratorApplied');
export const DECORATOR_APPLIED = Symbol('__decoratorApplied');
/**

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

}
export function ensureClassIsDecorated(instance) {
if (missingDecorator(instance.constructor)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +
'components or providers that are not decorated with UntilDestroy decorator');
}
}
export function createSubjectOnTheInstance(instance, symbol) {

@@ -56,5 +50,2 @@ if (!instance[symbol]) {

}
function missingDecorator(type) {
return !(DECORATOR_APPLIED in type.prototype);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJuYWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9pbnRlcm5hbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUkvQixNQUFNLFVBQVUsVUFBVSxDQUFDLE1BQWU7SUFDeEMsT0FBTyxPQUFPLE1BQU0sS0FBSyxVQUFVLENBQUM7QUFDdEMsQ0FBQztBQUVEOzs7R0FHRztBQUNILE1BQU0sT0FBTyxHQUFrQixNQUFNLENBQUMsV0FBVyxDQUFDLENBQUM7QUFFbkQ7O0dBRUc7QUFDSCxNQUFNLGlCQUFpQixHQUFrQixNQUFNLENBQUMsb0JBQW9CLENBQUMsQ0FBQztBQUV0RTs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsU0FBUyxDQUFJLGlCQUEyQjtJQUN0RCxJQUFJLE9BQU8saUJBQWlCLEtBQUssUUFBUSxFQUFFO1FBQ3pDLE9BQU8sTUFBTSxDQUFDLGNBQWMsaUJBQWlCLEVBQUUsQ0FBQyxDQUFDO0tBQ2xEO1NBQU07UUFDTCxPQUFPLE9BQU8sQ0FBQztLQUNoQjtBQUNILENBQUM7QUFFRCxNQUFNLFVBQVUsZUFBZSxDQUM3QixJQUE2RTtJQUU3RSw0RkFBNEY7SUFDNUYsc0RBQXNEO0lBQ3RELElBQUksQ0FBQyxTQUFTLENBQUMsaUJBQWlCLENBQUM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ICAgIGluc3RhbmNlW3N5bWJvbF0uY29tcGxldGUoKTtcbiAgICAvLyBXZSBhbHNvIGhhdmUgdG8gcmUtYXNzaWduIHRoaXMgcHJvcGVydHkgdGh1cyBpbiB0aGUgZnV0dXJlXG4gICAgLy8gd2Ugd2lsbCBiZSBhYmxlIHRvIGNyZWF0ZSBuZXcgc3ViamVjdCBvbiB0aGUgc2FtZSBpbnN0YW5jZS5cbiAgICBpbnN0YW5jZVtzeW1ib2xdID0gbnVsbDtcbiAgfVxufVxuIl19
import { takeUntil } from 'rxjs/operators';
import { getSymbol, isFunction, createSubjectOnTheInstance, completeSubjectOnTheInstance, ensureClassIsDecorated } from './internals';
import { DECORATOR_APPLIED, getSymbol, isFunction, createSubjectOnTheInstance, completeSubjectOnTheInstance } from './internals';
function overrideNonDirectiveInstanceMethod(instance, destroyMethodName, symbol) {
const originalDestroy = instance[destroyMethodName];
if (isFunction(originalDestroy) === false) {
if (ngDevMode && isFunction(originalDestroy) === false) {
throw new Error(`${instance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}`);

@@ -10,3 +10,3 @@ }

instance[destroyMethodName] = function () {
isFunction(originalDestroy) && originalDestroy.apply(this, arguments);
originalDestroy.apply(this, arguments);
completeSubjectOnTheInstance(this, symbol);

@@ -29,3 +29,3 @@ // We have to re-assign this property back to the original value.

else {
ensureClassIsDecorated(instance);
ngDevMode && ensureClassIsDecorated(instance);
createSubjectOnTheInstance(instance, symbol);

@@ -36,2 +36,10 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW50aWwtZGVzdHJveWVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi91bnRpbC1kZXN0cm95ZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTNDLE9BQU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2V0U3ltYm9sPFQ+KGRlc3Ryb3lNZXRob2ROYW1lKTtcblxuICAgIC8vIElmIGBkZXN0cm95TWV0aG9kTmFtZWAgaXMgcGFzc2VkIHRoZW4gdGhlIGRldmVsb3BlciBhcHBsaWVzXG4gICAgLy8gdGhpcyBvcGVyYXRvciB0byBzb21ldGhpbmcgbm9uLXJlbGF0ZWQgdG8gQW5ndWxhciBESSBzeXN0ZW1cbiAgICBpZiAodHlwZW9mIGRlc3Ryb3lNZXRob2ROYW1lID09PSAnc3RyaW5nJykge1xuICAgICAgb3ZlcnJpZGVOb25EaXJlY3RpdmVJbnN0YW5jZU1ldGhvZChpbnN0YW5jZSwgZGVzdHJveU1ldGhvZE5hbWUsIHN5bWJvbCk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGVuc3VyZUNsYXNzSXNEZWNvcmF0ZWQoaW5zdGFuY2UpO1xuICAgICAgY3JlYXRlU3ViamVjdE9uVGhlSW5zdGFuY2UoaW5zdGFuY2UsIHN5bWJvbCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHNvdXJjZS5waXBlKHRha2VVbnRpbDxVPigoaW5zdGFuY2UgYXMgYW55KVtzeW1ib2xdKSk7XG4gIH07XG59XG4iXX0=
function ensureClassIsDecorated(instance) {
const prototype = Object.getPrototypeOf(instance);
const missingDecorator = !(DECORATOR_APPLIED in prototype);
if (missingDecorator) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +
'components or providers that are not decorated with UntilDestroy decorator');
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW50aWwtZGVzdHJveWVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi91bnRpbC1kZXN0cm95ZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTNDLE9BQU8sR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UoaW5zdGFuY2UsIHN5bWJvbCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHNvdXJjZS5waXBlKHRha2VVbnRpbDxVPigoaW5zdGFuY2UgYXMgYW55KVtzeW1ib2xdKSk7XG4gIH07XG59XG5cbmZ1bmN0aW9uIGVuc3VyZUNsYXNzSXNEZWNvcmF0ZWQoaW5zdGFuY2U6IEluc3RhbmNlVHlwZTxhbnk+KTogbmV2ZXIgfCB2b2lkIHtcbiAgY29uc3QgcHJvdG90eXBlID0gT2JqZWN0LmdldFByb3RvdHlwZU9mKGluc3RhbmNlKTtcbiAgY29uc3QgbWlzc2luZ0RlY29yYXRvciA9ICEoREVDT1JBVE9SX0FQUExJRUQgaW4gcHJvdG90eXBlKTtcblxuICBpZiAobWlzc2luZ0RlY29yYXRvcikge1xuICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICd1bnRpbERlc3Ryb3llZCBvcGVyYXRvciBjYW5ub3QgYmUgdXNlZCBpbnNpZGUgZGlyZWN0aXZlcyBvciAnICtcbiAgICAgICAgJ2NvbXBvbmVudHMgb3IgcHJvdmlkZXJzIHRoYXQgYXJlIG5vdCBkZWNvcmF0ZWQgd2l0aCBVbnRpbERlc3Ryb3kgZGVjb3JhdG9yJ1xuICAgICk7XG4gIH1cbn1cbiJdfQ==

@@ -42,8 +42,2 @@ import { ɵNG_PIPE_DEF } from '@angular/core';

}
function ensureClassIsDecorated(instance) {
if (missingDecorator(instance.constructor)) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +
'components or providers that are not decorated with UntilDestroy decorator');
}
}
function createSubjectOnTheInstance(instance, symbol) {

@@ -63,5 +57,2 @@ if (!instance[symbol]) {

}
function missingDecorator(type) {
return !(DECORATOR_APPLIED in type.prototype);
}

@@ -118,3 +109,3 @@ function unsubscribe(property) {

const originalDestroy = instance[destroyMethodName];
if (isFunction(originalDestroy) === false) {
if (ngDevMode && isFunction(originalDestroy) === false) {
throw new Error(`${instance.constructor.name} is using untilDestroyed but doesn't implement ${destroyMethodName}`);

@@ -124,3 +115,3 @@ }

instance[destroyMethodName] = function () {
isFunction(originalDestroy) && originalDestroy.apply(this, arguments);
originalDestroy.apply(this, arguments);
completeSubjectOnTheInstance(this, symbol);

@@ -143,3 +134,3 @@ // We have to re-assign this property back to the original value.

else {
ensureClassIsDecorated(instance);
ngDevMode && ensureClassIsDecorated(instance);
createSubjectOnTheInstance(instance, symbol);

@@ -150,2 +141,10 @@ }

}
function ensureClassIsDecorated(instance) {
const prototype = Object.getPrototypeOf(instance);
const missingDecorator = !(DECORATOR_APPLIED in prototype);
if (missingDecorator) {
throw new Error('untilDestroyed operator cannot be used inside directives or ' +
'components or providers that are not decorated with UntilDestroy decorator');
}
}

@@ -152,0 +151,0 @@ /**

@@ -5,2 +5,6 @@ import { InjectableType, ɵDirectiveType, ɵComponentType } from '@angular/core';

/**
* Applied to definitions and informs that class is decorated
*/
export declare const DECORATOR_APPLIED: unique symbol;
/**
* If we use the `untilDestroyed` operator multiple times inside the single

@@ -19,4 +23,3 @@ * instance providing different `destroyMethodName`, then all streams will

}
export declare function ensureClassIsDecorated(instance: any): never | void;
export declare function createSubjectOnTheInstance(instance: any, symbol: symbol): void;
export declare function completeSubjectOnTheInstance(instance: any, symbol: symbol): void;

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

{"__symbolic":"module","version":4,"metadata":{"UntilDestroy":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":67,"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":67,"character":9,"module":"./lib/until-destroy"}},"untilDestroyed":{"__symbolic":"function","parameters":["instance","destroyMethodName"],"value":{"__symbolic":"error","message":"Lambda not supported","line":42,"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": "8.0.3",
"version": "8.0.4",
"repository": {

@@ -45,2 +45,2 @@ "type": "git",

"metadata": "ngneat-until-destroy.metadata.json"
}
}

@@ -5,3 +5,4 @@ # 🦁 Unsubscribe For Pros

![@ngneat/until-destroy](https://github.com/ngneat/until-destroy/workflows/@ngneat/until-destroy/badge.svg)
[![@ngneat/until-destroy](https://github.com/ngneat/until-destroy/workflows/@ngneat/until-destroy/badge.svg)](https://github.com/ngneat/until-destroy/actions/workflows/until-destroy.yml)
[![npm](https://img.shields.io/npm/dm/@ngneat/until-destroy?style=plastic)](https://www.npmjs.com/package/@ngneat/until-destroy)

@@ -179,2 +180,7 @@ ## Table of contents

## ESLint Rules
- [prefer-takeuntil](https://github.com/cartant/eslint-plugin-rxjs-angular/blob/main/docs/rules/prefer-takeuntil.md#options)
- [no-unsafe-takeuntil](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-unsafe-takeuntil.md#options)
## Contributors ✨

@@ -181,0 +187,0 @@

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