Skip to content

Commit 59a8aac

Browse files
authored
Merge pull request #26 from elasticias/fix/restore-ngondestroy
1.0.1 — restore ngOnDestroy on the V2 abstracts
2 parents 2c7a76c + 38f1ce4 commit 59a8aac

9 files changed

Lines changed: 40 additions & 9 deletions

libs/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elasticias/core",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"peerDependencies": {
55
"@angular/common": "^21.0.0",
66
"@angular/core": "^21.0.0",

libs/screens/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elasticias/screens",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"peerDependencies": {
55
"@angular/common": "^21.0.0",
66
"@angular/core": "^21.0.0",

libs/screens/src/lib/abstract/screen/abstract-detail-screen-v2.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
Component,
33
DestroyRef,
44
Injector,
5-
OnInit,
5+
OnDestroy, OnInit,
66
computed,
77
inject,
88
signal,
@@ -450,4 +450,12 @@ export abstract class AbstractDetailScreenV2<TItem extends object = any>
450450
return m ? m[1] : url;
451451
}
452452

453+
// AbstractComponent declares `abstract ngOnDestroy()`, so this must exist.
454+
// There is genuinely nothing to tear down here; removing it would push the
455+
// requirement onto every consumer component.
456+
// eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
457+
ngOnDestroy(): void {
458+
// The route subscription is auto-unsubscribed via takeUntilDestroyed.
459+
// Subclasses can override to release their own resources.
460+
}
453461
}

libs/screens/src/lib/abstract/screen/abstract-report-screen-v2.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
Component,
33
inject,
44
Injector,
5-
OnInit,
5+
OnDestroy, OnInit,
66
Signal,
77
signal,
88
} from '@angular/core';
@@ -218,4 +218,11 @@ export abstract class AbstractReportScreenV2
218218
);
219219
}
220220

221+
// AbstractComponent declares `abstract ngOnDestroy()`, so this must exist.
222+
// There is genuinely nothing to tear down here; removing it would push the
223+
// requirement onto every consumer component.
224+
// eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
225+
ngOnDestroy(): void {
226+
// NSwag observables complete after one emission — nothing to tear down.
227+
}
221228
}

libs/screens/src/lib/abstract/screen/abstract-search-screen-v2.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
computed,
44
inject,
55
Injector,
6-
OnInit,
6+
OnDestroy, OnInit,
77
signal,
88
} from '@angular/core';
99
import { take } from 'rxjs';
@@ -798,4 +798,12 @@ export abstract class AbstractSearchScreenV2<TItem = any>
798798
});
799799
}
800800

801+
// AbstractComponent declares `abstract ngOnDestroy()`, so this must exist.
802+
// There is genuinely nothing to tear down here; removing it would push the
803+
// requirement onto every consumer component.
804+
// eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
805+
ngOnDestroy(): void {
806+
// Subclasses can override to clean up subscriptions; nothing to
807+
// tear down on the base since search subscriptions auto-complete.
808+
}
801809
}

libs/screens/src/lib/abstract/screen/abstract-sub-screen-v2.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
Component,
33
inject,
44
Injector,
5-
OnInit,
5+
OnDestroy, OnInit,
66
signal,
77
} from '@angular/core';
88
import { Permissions } from '@elasticias/types';
@@ -79,4 +79,12 @@ export abstract class AbstractSubScreenV2
7979
}
8080
}
8181

82+
// AbstractComponent declares `abstract ngOnDestroy()`, so this must exist.
83+
// There is genuinely nothing to tear down here; removing it would push the
84+
// requirement onto every consumer component.
85+
// eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
86+
ngOnDestroy(): void {
87+
// NSwag observables complete after one emission — nothing to tear
88+
// down; subclasses override when they hold live subscriptions.
89+
}
8290
}

libs/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elasticias/types",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"sideEffects": false,
55
"repository": {
66
"type": "git",

libs/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elasticias/ui",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"peerDependencies": {
55
"@angular/common": "^21.0.0",
66
"@angular/core": "^21.0.0",

libs/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elasticias/utils",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"sideEffects": false,
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)