Skip to content

Commit

Permalink
chore: Fixed setCacheInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
Masyaka committed Oct 13, 2023
1 parent de48acf commit 8f607a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/set-cache-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ export function setCacheInstance<
S extends ContainerServices<C>,
K extends keyof S,
>(container: C, key: K, instance: S[K]) {
if (!(container instanceof DIContainer)) {
throw new Error('Only DIContainer supported');
}
_setSingletonInstance.call(container, key, instance);
}

0 comments on commit 8f607a1

Please sign in to comment.