-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Typescript support #38
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
Conversation
I think I finally got the action types in a decent state. 😄 The disadvantage is that in TS files createReducer now requires both its generic arguments (state type and union of action types), but it maps each slice reducer's key to the appropriate action type so slice reducer arguments can be inferred. Usage in JS files should be unaffected, though I'm not 100% sure if I got the Babel 7 config working with external helpers properly. Declaration files are also added to dist in the install script, so types should be published automatically. The normal JS builds still work without the TS compiler or Babel preset. I'd appreciate a code review, but I still need to finish selectorator before this can be merged. |
@neurosnap By the way thanks for your advice on createReducer types, here's what I have so far: https://github.com/nickmccurdy/redux-starter-kit/blob/typescript/src/createReducer.ts |
I'd be happy to update this if we can switch from Selectorator to Reselect |
Remind me what the specific difficulties are in adding types to Selectorator? |
@nickmccurdy : ping What are the specific problems typing Selectorator? Is it primarily the multiple-parameters issue? What would be your thoughts on cloning Selectorator into the lib, and maybe enforcing only passing the input selectors as an array instead of multiple args? |
Superseded by #73 . |
Co-authored-by: Matt Sutkowski <[email protected]> Co-authored-by: Lenz Weber <[email protected]>
I would appreciate code reviews but please do not merge yet.
Strictly type with TypeSscript 3 (does not support TypeScript 2)
Use Babel 7 to retain similar build tooling
Attempt to make createReducer Action types safe (requires complex mapped types and inference)
Set up declaration publishing
Finish typing selectorator
Fixes Support Redux 4 #28
Fixes Typing support #30