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: remove async support from effectFn and cleanupFn #12

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Conversation

dmaskasky
Copy link
Member

@dmaskasky dmaskasky commented Oct 17, 2023

Remove async support from effectFn and cleanupFn.

Related Discussion: #10
Related PR: pmndrs/jotai#2189

TODO: bump minor after this change.

@dmaskasky dmaskasky requested a review from dai-shi October 17, 2023 00:14
@codesandbox-ci
Copy link

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 6b99ea8:

Sandbox Source
React Configuration
React TypeScript Configuration

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.

Looks good to me. This is so much more predictable.

@dmaskasky
Copy link
Member Author

Looks good to me. This is so much more predictable.

I agree. The main issue with async I feel is the expectation that the effectFn will rerun multiple times independently but in reality atom deps are not updated until the promise resolves and overlapping runs will block each other.

@dmaskasky dmaskasky merged commit 71930ed into main Oct 17, 2023
@dai-shi dai-shi deleted the no-async branch October 17, 2023 00:59
@dmaskasky
Copy link
Member Author

dmaskasky commented Oct 17, 2023 via email

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.

3 participants