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

Make use_state a single value again #290

Merged
merged 2 commits into from
Mar 4, 2022
Merged

Conversation

jkelleyrtp
Copy link
Member

This PR is a middle ground between the original UseState and the new react UseState. It doesn't implement copy (so you can call clone for async) but it is a single value - which should be clearer.

It does introduce some more indirection (double asterisk or .get() when trying to access the underlying value).

I think we lose some ergonomics but we can some consistency and clarity.

@jkelleyrtp jkelleyrtp force-pushed the jk/use-state-unify branch from c991a36 to 6c3f519 Compare March 4, 2022 19:29
@jkelleyrtp jkelleyrtp merged commit b11eff9 into master Mar 4, 2022
@jkelleyrtp jkelleyrtp deleted the jk/use-state-unify branch April 27, 2022 05:34
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

Successfully merging this pull request may close these issues.

1 participant