-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
readAtomState is called many times redundantly before atoms are mounted #2333
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 9a687e8:
|
@@ -772,6 +802,8 @@ export const createStore = () => { | |||
l({ type: 'restore', flushed: flushed as Set<AnyAtom> }), | |||
) | |||
}, | |||
dev_print_call_counts: printCounts, | |||
dev_clear_call_counts: resetCounts, | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary for our core library? I think making a wrapper in user side should make more sense
store.dev_clear_call_counts?.() | ||
} | ||
it('Avoid redundant readAtomState while unmount', () => { | ||
console.debug('Test case without unmounted cache') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove console?
store.dev_print_call_counts?.() | ||
store.dev_clear_call_counts?.() | ||
} | ||
it('Avoid redundant readAtomState while unmount', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this test case we didn't expect anything. just run the code? I think we should add some counter to make sure behavior is stable
As I understand, this is not something to be merged. Let's convert it to draft. |
We would like to learn the problems and the possible solutions, outside the core. I'm interested in seeing it to move forward, but closing this. |
Related Issues or Discussions
#2334
Summary
This PR is here to showcase the issue with a potential fix, not to be merged.
Check List
yarn run prettier
for formatting code and docs