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/flush pending finally everywhere #2816

Conversation

dmaskasky
Copy link
Collaborator

Related Bug Reports or Discussions

Fixes #

Summary

Check List

  • pnpm run prettier for formatting code and docs

Copy link

vercel bot commented Nov 14, 2024

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 Nov 14, 2024 2:06am

@dmaskasky dmaskasky changed the base branch from main to fix/flush-pending-async November 14, 2024 01:05
Copy link

codesandbox-ci bot commented Nov 14, 2024

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.

Copy link

github-actions bot commented Nov 14, 2024

LiveCodes Preview in LiveCodes

Latest commit: f796dd2
Last updated: Nov 14, 2024 2:06am (UTC)

Playground Link
React demo https://livecodes.io?x=id/34VUXRNSQ

See documentations for usage instructions.

src/vanilla/store.ts Outdated Show resolved Hide resolved
src/vanilla/store.ts Outdated Show resolved Hide resolved
src/vanilla/store.ts Outdated Show resolved Hide resolved
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.

Not a big fan of many try-finally syntax, but it feels safer.

@dai-shi dai-shi merged commit e900fbc into pmndrs:fix/flush-pending-async Nov 14, 2024
40 checks passed
dai-shi added a commit that referenced this pull request Nov 14, 2024
* fix: flushPending in async write

* isSync in onMount to

* apply the change

* add test for flushPending (#2809)

* Fix/flush pending finally everywhere (#2816)

* call onmount flushPending in finally block

* temp remove unmount test cases. to be fixed later with pending injection (#2810)

* flushpending everywhere

* Apply suggestions from code review

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

* fix type assertion

---------

Co-authored-by: David Maskasky <dmaskasky@gmail.com>
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