-
Notifications
You must be signed in to change notification settings - Fork 669
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
Typed the props
argument on the selectors created by createSelector
, and added typings test cases.
#115
Conversation
The tests should probably be runnable by Travis CI. Anyone know how to fix? |
Current coverage is 100%
|
@@ -5,22 +5,22 @@ | |||
|
|||
declare module Reselect { | |||
|
|||
type Selector<TInput, TOutput> = (state: TInput, props?: any) => TOutput; | |||
type Selector<TInput, TProps, TOutput> = (state: TInput, TProps, props?: TProps) => TOutput; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a typo? That looks like you accidentally included a required implicit any parameter named TProps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Yes.
@@ -0,0 +1,22 @@ | |||
|
|||
export type RootState = { | |||
items: {[key: string]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you convert tabs to spaces to match the other files? It's a small thing, but it'll help avoid whitespace changes on future diffs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thanks for this @geon! And thanks @threehams for reviewing and merging. Much appreciated! |
The test is done by simply running
tsc
in the/tests/typings/
folder. If it compiles, everything is fine.