Skip to content
New issue

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

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

Already on GitHub? # to your account

createStore should perhaps accept preloadedState: PreloadedState<S> | S #3672

Closed
abirmingham opened this issue Jan 6, 2020 · 2 comments
Closed

Comments

@abirmingham
Copy link

abirmingham commented Jan 6, 2020

At least as of 4.0.5, createStore accepts preloadedState: PreloadedState<S>. One imagines that one can pass S to preloadedState, and in most cases this is correct. However, there are cases in which S is not assignable to PreloadedState<S>, at least since typescript@3.6.3. See microsoft/TypeScript#35992 for more information on this issue. It's unclear to me whether microsoft/TypeScript#35992 is a typescript bug, but I'm wondering if createStore should accept preloadedState: PreloadedState<S> | S, which would mitigate the issue of branded types being mapped to never.

@abirmingham abirmingham changed the title createStore should accept preloadedState: PreloadedState<S> | S createStore should perhaps accept preloadedState: PreloadedState<S> | S Jan 6, 2020
@timdorr
Copy link
Member

timdorr commented Jan 6, 2020

This is fixed for 5.0 via #3485.

@timdorr timdorr closed this as completed Jan 6, 2020
@abirmingham
Copy link
Author

This is fixed for 5.0 via #3485.

Thanks @timdorr !!!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants