-
Notifications
You must be signed in to change notification settings - Fork 674
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
[TypeScript] Should input selectors' states be merged? #264
Comments
I think this is a viable proposal, although it would be a breaking change since type parameters are changed. What if we include both old and new signatures? Would the tests pass then? |
Also, why doesn't it work as is? |
The error is
|
Including both old and new signatures works but tests are still broken. I think the first test was broken from the beginning. It looks like the state is infered from the first input selector so if we switch order it doesn't work anyway. This doesn't work:
|
Yep, I guess this is just a mistake in the test. The only thing that bothers me is that the typings become extra bloated. Would be nice if we could someday generate all those signatures from a template. Otherwise, I am 👍 for this change. |
I just encountered this and would love to get this fix. What are next steps for moving this forward? |
Please help test the updated typings: #274 |
I actually work with Ben, so minus some issues with typescript 2.4 I'm pretty confident of the typings :) |
@DenisNeustroev No progress from my side. We are using our own fork of the typings in our project. |
Closing is this seems to be stale. If it's still a problem, please comment and we can discuss further. |
I'm building a modular application (in TypeScript) that has isolated root app states for modules. My main application's state just extends all the modules.
The probem is I want to use selectors from different modules as input selectors. I could achieve that with explicit type casting but the code becomes very verbose.
I've forked the library to add input selectors' state and props merging but it breaks some existing tests.
master...bancek:master
First broken test:
never
should be replaced with empty interface becauseFooModuleState & BarModuleState & never
seems to becomenever
.Second broken test:
Default state type inference does not work anymore.
My use case example:
The text was updated successfully, but these errors were encountered: