Fix document details (#1752)

export const useBoundStore = create((set) => ({
  count: 0,
  text: 'hello',
  inc: () => set((state) => ({ count: state.count + 1 })),
  setText: (text) => set({ text }),
})

example on this page is missing a trailing parenthesis
This commit is contained in:
zc627788 2023-04-17 10:01:56 +08:00 committed by GitHub
parent 7cdb5f5bb2
commit df38aa8c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ export const useBoundStore = create((set) => ({
text: 'hello', text: 'hello',
inc: () => set((state) => ({ count: state.count + 1 })), inc: () => set((state) => ({ count: state.count + 1 })),
setText: (text) => set({ text }), setText: (text) => set({ text }),
}) }))
``` ```
This creates a self-contained store with data and actions together. This creates a self-contained store with data and actions together.