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

Use same return type for both StoreCreator signatures in TS typings #2985

Merged
merged 1 commit into from
May 11, 2018

Conversation

reklawnos
Copy link
Contributor

When performing a refactor, I noticed that removing the preloadedState param from a createStore call resulted in a different type than calling createStore with preloadedState. This is due to the return type of StoreCreator being slightly different for each signature. Specifically, the one without preloadedState does not include a type param for the action type.

This PR adds the action as a type param for the return type of the createStore function without a preloadedState param, as well as a couple of additional tests in tests/typescript/store.ts that make sure the action type param is included in the return type for both signatures.

@aikoven aikoven self-requested a review May 11, 2018 11:48
@timdorr
Copy link
Member

timdorr commented May 11, 2018

Thanks!

@timdorr timdorr merged commit c308849 into reduxjs:master May 11, 2018
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.

3 participants