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

Why records instead of Variants? #76

Closed
a-c-sreedhar-reddy opened this issue Jan 5, 2021 · 2 comments
Closed

Why records instead of Variants? #76

a-c-sreedhar-reddy opened this issue Jan 5, 2021 · 2 comments

Comments

@a-c-sreedhar-reddy
Copy link

Hi,

Any reason why the use function returns records instead of variants?

@jeddeloh
Copy link
Owner

jeddeloh commented Jan 5, 2021

Some of us found them to be a bit of a trap. You can see the discussion in the original reason-apollo-hooks PR here: reasonml-community/reason-apollo-hooks#122 (comment)

@jfrolich
Copy link
Collaborator

jfrolich commented Jan 6, 2021

Mostly because the state was not always mutually exclusive - like it can be (re)loading and have data - so you would end up with a lot of variants. A product type is better for this, and we can pattern match on it as well.

@jeddeloh jeddeloh closed this as completed Jan 7, 2021
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

No branches or pull requests

3 participants