From 1fba624d56f115cbbb7abe438abccb9eb3ce2ad1 Mon Sep 17 00:00:00 2001 From: Masum ULU <49063256+masumulu28@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:56:07 +0300 Subject: [PATCH] remove: `visibleItems` parameter from publish method and write hide logic inside of it --- .../core/src/lib/services/routes.service.ts | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/services/routes.service.ts b/npm/ng-packs/packages/core/src/lib/services/routes.service.ts index 8faab8cedf..f1c2327684 100644 --- a/npm/ng-packs/packages/core/src/lib/services/routes.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/routes.service.ts @@ -83,10 +83,10 @@ export abstract class AbstractTreeService !this.hide(item)))); return flatItems; } @@ -99,13 +99,11 @@ export abstract class AbstractTreeService !this.hide(item)); - return this.publish(flatItems, visibleItems); + return this.publish(flatItems); } else { const flatItems = this.flat.concat(items); flatItems.sort(this.sort); - const visibleItems = flatItems.filter(item => !this.hide(item)); - return this.publish(flatItems, visibleItems); + return this.publish(flatItems); } } @@ -125,9 +123,7 @@ export abstract class AbstractTreeService !willRemoveItems.includes(item)); - const visibleItems = flatItems.filter(item => !this.hide(item)); - - return this.publish(flatItems, visibleItems); + return this.publish(flatItems); } return this.flat; @@ -156,9 +152,7 @@ export abstract class AbstractTreeService !this.hide(item)); - - return this.publish(flatItems, visibleItems); + return this.publish(flatItems); } refresh(): T[] { @@ -171,9 +165,7 @@ export abstract class AbstractTreeService !this.hide(item)); - - return this.publish(flatItems, visibleItems); + return this.publish(flatItems); } search(params: Partial, tree = this.tree): TreeNode | null {