Skip to content

Commit

Permalink
fix: rename params to args
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Jul 30, 2020
1 parent 6751211 commit 7fa8fad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
type Deps<T extends Record<string, any>> = {
[P in keyof T]: T[P] extends { _velona: boolean }
? (...deps: Parameters<T[P]>) => ReturnType<T[P]>
? (...args: Parameters<T[P]>) => ReturnType<T[P]>
: T[P]
}

export const depend = <T extends Record<string, any>, U extends [] | [any, ...any[]], V>(
dependencies: T,
cb: (deps: Deps<T>, ...params: U) => V
cb: (deps: Deps<T>, ...args: U) => V
) => {
const fn = (...args: U) => cb(dependencies, ...args)
fn._velona = true
Expand Down

0 comments on commit 7fa8fad

Please sign in to comment.