Skip to content

Commit

Permalink
infer dependency type
Browse files Browse the repository at this point in the history
  • Loading branch information
ragokan committed Sep 7, 2024
1 parent 21fe3b4 commit aed2e9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/server/src/helpers/di.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface __DependencyStore {
get: GetDependencyFn;
}

export type InferDependencyType<T> = T extends Dependency<infer U> ? U : never;

export function dependency<T>(create: __CreateFn<T>): Dependency<T> {
return {
id: Symbol("Dependency ID"),
Expand Down

0 comments on commit aed2e9b

Please sign in to comment.