Skip to content

Commit

Permalink
pnpm run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
probeiuscorp committed Sep 7, 2024
1 parent 0ae2432 commit 0290bb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions docs/basics/functional-programming-and-jotai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ const greetingAtom = atom((get) => {
```

Now, compare that code with `async``await`:

```tsx
const namePromise = Promise.resolve('Visitor')
const countPromise = Promise.resolve(1)
const greetingPromise = (async function() {
const name = await namePromise;
const count = await countPromise;
const greetingPromise = (async function () {
const name = await namePromise
const count = await countPromise
return (
<div>
Hello, {nameAtom}! You have visited this page {countAtom} times.
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function Controls() {
### Note about functional programming
Jotai's fluid interface is no accident — atoms are monads, just like promises!
Monads are an [established](https://en.wikipedia.org/wiki/Monad_(functional_programming))
Monads are an [established](<https://en.wikipedia.org/wiki/Monad_(functional_programming)>)
pattern for modular, pure, robust and understandable code which is [optimized for change](https://overreacted.io/optimized-for-change/).
Read more about [Jotai and monads.](https://jotai.org/docs/basics/functional-programming-and-jotai)
Expand Down

0 comments on commit 0290bb7

Please sign in to comment.