Skip to content

improve types #201

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

Merged
merged 1 commit into from
Jul 9, 2018
Merged

Conversation

no-stack-dub-sack
Copy link
Contributor

@AntJanus per #200 updates the types for connect to allow for a null first argument in the event that your component does not require a mapStateToThis function.

Also, makes various updates to the types, and adds type annotations (taken from redux) for an improved intellisense experience. Updates to the types themselves include:

  • replacing Reducer, MiddlewareArg, and Middleware with more precise types taken from redux typings
  • removing getReducer, which is no longer part of the redux API (so far as I can tell)
  • indicate that connect returns Unsubscribe
  • replace references to Object with the non-primitive object type, in mapDispatchToTarget - though these types could definitely be improved further and made more specific to avoid referencing this as all, however, I didn't have the time today to put together really well thought out types for this.

Let me know what you think or if you'd like to see any changes to this.

closes #200

@bensgroi
Copy link

Great - being able to use generics with INgRedux.getState() would be really useful.

@no-stack-dub-sack
Copy link
Contributor Author

@AntJanus ☝️ just a reminder on this PR. Any chance you can review?

@AntJanus AntJanus merged commit 1fe5a42 into angular-redux:master Jul 9, 2018
@no-stack-dub-sack
Copy link
Contributor Author

👍

@no-stack-dub-sack no-stack-dub-sack deleted the fix/types branch July 9, 2018 19:23
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 this pull request may close these issues.

types: connect should allow null as the first argument
3 participants