-
-
Notifications
You must be signed in to change notification settings - Fork 649
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(utils): make 'loadable' update immediate after resolve #2790
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. |
|
Playground | Link |
---|---|
React demo | https://livecodes.io?x=id/4X3FU592T |
See documentations for usage instructions.
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.
This is nice catch!
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.
LGTM. I'll merge this when we prepare the next version.
* fix(utils): make 'loadable' update immediate after resolve * fix comments in pmndrs#2790 --------- Co-authored-by: Daishi Kato <[email protected]>
Summary
This commit aims to update the Loadable state derived from
loadable
immediately after the Promise resolves.The original code used the following approach to update the loadable cache, which resulted in a delay of one tick for the cache update:
The use of
.finally
as shown above causes the following case to fail:To resolve this issue,
setSelf
needs to be executed within the.then()
callback.Check List
pnpm run prettier
for formatting code and documentation.