Skip to content

docs: zustand/context correct doc, added snippets #433

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

Merged
merged 3 commits into from
Jun 13, 2021

Conversation

karthikcodes6
Copy link
Contributor

Corrected the wrong docs and added snippets to understand the createContext better. For more info check here

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 13, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 52415b2:

Sandbox Source
React Configuration
React Typescript Configuration

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Thanks for your suggestion!
We have docs only in readme & wiki pages for now.
Would you move the snippet either in a) <details> in readme.md, b) a new wiki page?
I prefer a wiki page so that you and others can add more snippets.

readme.md Outdated
@@ -456,10 +456,10 @@ import createContext from 'zustand/context'

const { Provider, useStore } = createContext()

const store = create(...)
const store = () => create(...)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const store = () => create(...)
const createStore = () => create(...)

Maybe this seems better?

Copy link
Contributor Author

@karthikcodes6 karthikcodes6 Jun 13, 2021

Choose a reason for hiding this comment

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

I would prefer the snippets to be in the repo. What if we added wiki snippets reference in the README.md and that person edit it later. That'll become a problem. I think the details should work.

@dai-shi dai-shi merged commit c5c473d into pmndrs:master Jun 13, 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.

2 participants