-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add common hook type (Fix #80) #81
Conversation
This is a super slick solution afaict, nice. Any thoughts about reexposing the result type (and any other relevant types) from the ReasonUrql.Hooks module so that users don't have to open another module? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great @gugahoa! I agree with @Schmavery, is there a way for us to essentially re-export Types
in the Hooks
module so that it doesn't have to be opened by the user? Would it be enough to just include UrqlTypes
in the definition of module Hooks
? Just ping here once you've made the few requested changes 🤗 ❤️
I tried to make it not necessary to I tried making a Pinging @parkerziegler for re-review |
@gugahoa I'm surprised that adding Basically I reexposed the type using something like this in the Hooks module: type a = Types.a = {i: int}; |
@gugahoa can you try the above suggested by @Schmavery? If we get that to work then I think this is set to 🚢 |
Another thing to bring up while I'm here – do you happen to know how to handle GADTs in the component case? I got it working-ish w/
with the following error:
I wonder if there's any easy way around this 🤔 |
@Schmavery thanks for the suggestion, it worked perfectly! |
Yep, just pushed it up: https://github.com/FormidableLabs/reason-urql/tree/task/type-inference-gadt-for-subscription Here are the relevant lines: https://github.com/FormidableLabs/reason-urql/blob/task/type-inference-gadt-for-subscription/src/components/UrqlSubscription.re#L53-L80 Basically, I think the |
@parkerziegler seems like you found a bug, I tried to look for any issues that mentioned that, but couldn't find, so I created a new one on the reason-react repo: reasonml/reason-react#452 |
Thanks @gugahoa. I'm skeptical that we'll get support for it in the near future, so I'll push up a possible solution for us so that we can feature cap |
No description provided.