docs(typescript): supplement the missing ) symbol in the combine code example (#1082)

* docs(typescript): supplement the missing `)` symbol in the `combine` code example

* style(docs/typescript): formatting
This commit is contained in:
xlboy 2022-07-13 19:56:29 +08:00 committed by GitHub
parent c0e074f19a
commit 85a5959a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,12 +118,14 @@ And now `T` gets inferred and you get to annotate `E` too. Zustand has the same
Alternatively you can also use `combine` which infers the state instead of you having to type it...
```ts
import create from "zustand"
import { combine } from "zustand/middleware"
import create from 'zustand'
import { combine } from 'zustand/middleware'
const useStore = create(combine({ bears: 0 }, (set) => ({
increase: (by: number) => set((state) => ({ bears: state.bears + by })),
}))
const useStore = create(
combine({ bears: 0 }, (set) => ({
increase: (by: number) => set((state) => ({ bears: state.bears + by })),
}))
)
```
<details>