Skip to content

Commit

Permalink
add typescript usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Aug 12, 2023
1 parent 208d3c9 commit 9c523dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/api/utils/devtools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ subscribe(state, () => {
const obj = snapshot(state) // A snapshot is an immutable object
})
````
#### Use it with TypeScript
It's recommended to install and import types from`@redux-devtools/extension` to get types correctly.
```ts
import type {} from '@redux-devtools/extension'
import { devtools } from 'valtio/utils'
```

0 comments on commit 9c523dd

Please sign in to comment.