Skip to content

Commit

Permalink
Remove redundant parameter (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad authored Dec 23, 2024
1 parent b6aa1bd commit aa6d0bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/awilixManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export class AwilixManager {
await asyncDispose(this.config.diContainer)
}

getWithTags(diContainer: AwilixContainer, tags: string[]): Record<string, any> {
return getWithTags(diContainer, tags)
getWithTags(tags: string[]): Record<string, any> {
return getWithTags(this.config.diContainer, tags)
}

getByPredicate(predicate: (entity: any) => boolean): Record<string, any> {
Expand Down
4 changes: 2 additions & 2 deletions test/awilixManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit aa6d0bc

Please sign in to comment.