Skip to content

docs: add currying for createStore#3171

Merged
dbritto-dev merged 1 commit into
pmndrs:mainfrom
soyboi:main
Jul 9, 2025
Merged

docs: add currying for createStore#3171
dbritto-dev merged 1 commit into
pmndrs:mainfrom
soyboi:main

Conversation

@soyboi

@soyboi soyboi commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

I hope this is a correct change, but I was reading the docs, and if I didn't misunderstand, we always need to do currying when creating a store with typescript. This seemed to be missing in the code example used in auto generating selectors.

@vercel

vercel Bot commented Jul 9, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zustand-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2025 4:33am

@codesandbox-ci

codesandbox-ci Bot commented Jul 9, 2025

Copy link
Copy Markdown

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.

@pkg-pr-new

pkg-pr-new Bot commented Jul 9, 2025

Copy link
Copy Markdown

demostarter

npm i https://pkg.pr.new/zustand@3171

commit: 45790fd

@dbritto-dev dbritto-dev closed this Jul 9, 2025
@dai-shi

dai-shi commented Jul 9, 2025

Copy link
Copy Markdown
Member

I'm fine to add it as it's TS code.
But, @dbritto-dev are you working on something else?

@dbritto-dev

Copy link
Copy Markdown
Collaborator

@dai-shi in the new docs under apis/middlewares we talked about that, we do have ts examples. BTW, everything else use js examples.

}

const store = createStore<BearState>((set) => ({
const store = createStore<BearState>()((set) => ({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a TS example, so it makes sense to have ().
Or, do you have a PR/branch that will be merged later? @dbritto-dev

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@dai-shi in that case we can merge this one

@dbritto-dev dbritto-dev reopened this Jul 9, 2025
@dbritto-dev dbritto-dev merged commit 5690980 into pmndrs:main Jul 9, 2025
30 checks passed
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.

3 participants