Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuple types is not resolved properly when multiple arguments are injected #20

Closed
Rokt33r opened this issue Aug 11, 2019 · 1 comment · Fixed by #21
Closed

Tuple types is not resolved properly when multiple arguments are injected #20

Rokt33r opened this issue Aug 11, 2019 · 1 comment · Fixed by #21

Comments

@Rokt33r
Copy link
Member

Rokt33r commented Aug 11, 2019

Expected

const numberSelector: Selector<number> = ...
const stringSelector: Selector<string> = ...

const handler = prismy([numberSelector, stringSelector], (numberValue, stringValue) => {
  ...
})

Typescrirpt should recognize the tuple, [number, string].

Current status

Typescript infers the type as (number | string )[]

@Rokt33r
Copy link
Member Author

Rokt33r commented Aug 11, 2019

For now, we need to provide types manually.

const handler = prismy<number, string>(...)

@Rokt33r Rokt33r changed the title Tuple types is not resolved properly Tuple types is not resolved properly when multiple arguments are injected Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant