Skip to content

Commit 1321830

Browse files
committed
refactor: restore momoization for nav item
1 parent e542a30 commit 1321830

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/components/src/navigation/nav-item/nav-item.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { NavItemLinkConfig, NavViewStyle } from '../navigation.config';
99
styleUrls: ['./nav-item.component.scss'],
1010
changeDetection: ChangeDetectionStrategy.OnPush,
1111
template: `
12-
<ht-link *ngIf="this.config" [paramsOrUrl]="this.buildNavigationParam(this.config)">
12+
<ht-link *ngIf="this.config" [paramsOrUrl]="buildNavigationParam | htMemoize: this.config">
1313
<div
1414
*htIfFeature="this.config.featureState$ | async as featureState"
1515
class="nav-item"
@@ -57,7 +57,7 @@ export class NavItemComponent {
5757
@Input()
5858
public readonly navItemViewStyle?: NavViewStyle;
5959

60-
public buildNavigationParam(item: NavItemLinkConfig): NavigationParams {
60+
public buildNavigationParam = (item: NavItemLinkConfig): NavigationParams => {
6161
const navParams: NavigationParams = {
6262
navType: NavigationParamsType.InApp,
6363
path: item.matchPaths[0],
@@ -73,7 +73,7 @@ export class NavItemComponent {
7373
}
7474

7575
return navParams;
76-
}
76+
};
7777

7878
public constructor(
7979
private readonly activatedRoute: ActivatedRoute,

0 commit comments

Comments
 (0)