-
-
Notifications
You must be signed in to change notification settings - Fork 996
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
Export StoreWithState interface #339
Comments
PR welcome! v2 already does that |
I will have to release a version soon for v2 for the exposed types |
I completely missed 2.0.0-alpha.6 version that already has them exported 🤦♂️ as I was using 2.0.0-alpha.5, will try to make a PR for version one today at least. |
I don't understand what happened but in my 2.0.0-alpha.5 types were not exported but I can see that they were exported in both v1 and v2 branches long time ago. So I believe there is no need for PR, sorry for the confusion. |
I pushed a commit to expose the types to v1 and will release the next week or so after adding other changes to align as much as possible with v2 |
What problem is this solving
I am trying to create generic function for creating base stores. Something like this
I want to be able to provide additional actions and state data to this generic function. My problem is that I can't type my extended actions object like shown in the code above. Maybe I am doing it wrong way, but I think it would help if StoreWithState interface was exported so I can use it to type my actions object.
Proposed solution
Export type:
interface StoreWithState<Id extends string, S extends StateTree>
The text was updated successfully, but these errors were encountered: