From aa6d0bc5e5f8bd1f3b9effbd3da09c4b05a5751c Mon Sep 17 00:00:00 2001 From: Igor Savin Date: Mon, 23 Dec 2024 12:08:55 +0200 Subject: [PATCH] Remove redundant parameter (#39) --- README.md | 4 ++-- lib/awilixManager.ts | 4 ++-- test/awilixManager.spec.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 51c0978..59c21ed 100644 --- a/README.md +++ b/README.md @@ -148,9 +148,9 @@ const awilixManager = new AwilixManager({ }) // This will return a record with dependency1 and dependency2 -const result1 = awilixManager.getWithTags(diContainer, ['queue']) +const result1 = awilixManager.getWithTags(['queue']) // This will return a record with only dependency2 -const result2 = awilixManager.getWithTags(diContainer, ['queue', 'low-priority']) +const result2 = awilixManager.getWithTags(['queue', 'low-priority']) ``` ## Fetching dependencies based on a predicate diff --git a/lib/awilixManager.ts b/lib/awilixManager.ts index 42a7c29..7b0b148 100644 --- a/lib/awilixManager.ts +++ b/lib/awilixManager.ts @@ -80,8 +80,8 @@ export class AwilixManager { await asyncDispose(this.config.diContainer) } - getWithTags(diContainer: AwilixContainer, tags: string[]): Record { - return getWithTags(diContainer, tags) + getWithTags(tags: string[]): Record { + return getWithTags(this.config.diContainer, tags) } getByPredicate(predicate: (entity: any) => boolean): Record { diff --git a/test/awilixManager.spec.ts b/test/awilixManager.spec.ts index 7fcf6a2..f1d7f3d 100644 --- a/test/awilixManager.spec.ts +++ b/test/awilixManager.spec.ts @@ -459,13 +459,13 @@ describe('awilixManager', () => { }) const { dependency1, dependency2 } = diContainer.cradle - const result1 = awilixManager.getWithTags(diContainer, ['queue']) + const result1 = awilixManager.getWithTags(['queue']) expect(result1).toStrictEqual({ dependency1: dependency1, dependency2: dependency2, }) - const result2 = awilixManager.getWithTags(diContainer, ['queue', 'low-priority']) + const result2 = awilixManager.getWithTags(['queue', 'low-priority']) expect(result2).toStrictEqual({ dependency2: dependency2, })