Skip to content

Commit

Permalink
docs: fix typo (#2270)
Browse files Browse the repository at this point in the history
  • Loading branch information
wherehows authored Nov 26, 2023
1 parent 2238dae commit 7a65854
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guides/async.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Component = () => {

### Usage in TypeScript

In TypeScript `atom(0)` is inferred as `PrimitiveAtom<number>`. It cannot accept `Promise<number>` as a value so preceding code would not typecheck. To accomodate for that you need to type your atom explicitly and add `Promise<number>` as accepted value.
In TypeScript `atom(0)` is inferred as `PrimitiveAtom<number>`. It cannot accept `Promise<number>` as a value so preceding code would not typecheck. To accommodate for that you need to type your atom explicitly and add `Promise<number>` as accepted value.

```ts
const baseAtom = atom<number | Promise<number>>(0) // Will accept sync and async values
Expand Down

1 comment on commit 7a65854

@vercel
Copy link

@vercel vercel bot commented on 7a65854 Nov 26, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.