Skip to content

Commit

Permalink
fix(docs): Fix 'State' declaration position (#1438)
Browse files Browse the repository at this point in the history
* Fix 'State' declaration position

* Update auto-generating-selectors.md

Update pr with review

* Update auto-generating-selectors.md
  • Loading branch information
hicucu committed Dec 5, 2022
1 parent bf9d092 commit 47b2b64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guides/auto-generating-selectors.md
Expand Up @@ -14,13 +14,13 @@ However, writing these could be tedious. If that is the case for you, you can au
## create the following function: `createSelectors`

```typescript
import { State, StoreApi, UseBoundStore } from 'zustand'
import { StoreApi, UseBoundStore } from 'zustand'

type WithSelectors<S> = S extends { getState: () => infer T }
? S & { use: { [K in keyof T]: () => T[K] } }
: never

const createSelectors = <S extends UseBoundStore<StoreApi<State>>>(
const createSelectors = <S extends UseBoundStore<StoreApi<object>>>(
_store: S
) => {
let store = _store as WithSelectors<typeof _store>
Expand Down

0 comments on commit 47b2b64

Please sign in to comment.