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

Fix/useStore #431

Merged
merged 6 commits into from Jan 3, 2021
Merged

Fix/useStore #431

merged 6 commits into from Jan 3, 2021

Conversation

zarabotaet
Copy link
Member

Two different workarounds in two commits

@netlify
Copy link

netlify bot commented Dec 9, 2020

👷 Deploy request for effector-docs pending review.
Visit the deploys page to approve it

🔨 Explore the source changes: b404282

@zarabotaet zarabotaet changed the title Fix/use store Fix/useStore Dec 9, 2020
@zarabotaet
Copy link
Member Author

Because useState is a wrapper around useReducer we can directly take useReducer.
https://codesandbox.io/s/hopeful-lovelace-qeufx?file=/src/App.js
Sandbox to play with the proposed solution.

@zarabotaet zarabotaet marked this pull request as ready for review December 29, 2020 21:56
@zerobias zerobias self-requested a review December 30, 2020 17:01

const Display = () => {
const store = useStore($store)
fn()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a proof that issues does exists at all: your example reveal that current implementation works as expected

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@zerobias zerobias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, big thanks 👍 👍

@zerobias zerobias merged commit 6c2d143 into effector:master Jan 3, 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

Successfully merging this pull request may close these issues.

None yet

2 participants