Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation for useAtomCallback. #2150

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

stevemolitor
Copy link
Contributor

@stevemolitor stevemolitor commented Sep 27, 2023

Update the useAtomCallback documentation.

The docs were for Jotai v1; update for v2. The change is that the callback function passed to useAtomCallback no longer returns a Promise; it just returns the atom value.

@dai-shi I forked the CodeSanbox example here, removing the await that is no longer needed. However I wasn't sure how to update the CodeSanbox link (id) in the docs.

Related Issues or Discussions

Fixes #2149

Summary

Update the `useAtomCallback documentation for v2.

Check List

  • yarn run prettier for formatting code and docs

@vercel
Copy link

vercel bot commented Sep 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jotai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 1:25pm

@stevemolitor stevemolitor marked this pull request as draft September 27, 2023 02:40
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 27, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e26313f:

Sandbox Source
React Configuration
React TypeScript Configuration
React Browserify Configuration
React Snowpack Configuration
Next.js Configuration
Next.js with custom Babel config Configuration
React with custom Babel config Configuration
React Typescript (forked) PR

See pmndrs#2149. The docs were for Jotai v1; update
for v2. The change is that the callback function passed to `useAtomCallback` no longer
returns a Promise; it just returns the atom value.
@dai-shi
Copy link
Member

dai-shi commented Sep 27, 2023

However I wasn't sure how to update the CodeSanbox link (id) in the docs.

Just update the id in the docs. 95gxnt

@stevemolitor
Copy link
Contributor Author

However I wasn't sure how to update the CodeSanbox link (id) in the docs.

Just update the id in the docs. 95gxnt

Done - e26313f

I marked this PR as ready for review.

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks for your contribution!

@dai-shi dai-shi merged commit 39f100e into pmndrs:main Sep 27, 2023
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants