-
Notifications
You must be signed in to change notification settings - Fork 331
Improve createEffect and createRenderEffect reference
#1330
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
base: main
Are you sure you want to change the base?
Conversation
|
|
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
73217bb to
a50d1ff
Compare
| - The initial run of a render effect happens during the current rendering phase. | ||
| - It runs as DOM elements are being created and updated, but before they are mounted. | ||
| As a result, refs are _not_ set before a render effect runs for the first time. | ||
| - If multiple dependencies are updated within the same batch, the render effect only runs once. |
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.
If multiple dependencies are updated within the same batch, the render effect only runs once.
Id say (or something similar)
If multiple dependencies are updated within the same batch, the render effect will run one more time.
Because, when dependencies changed, the render effect already ran. So it has to run again, but yes, even if multiple dependencies has been updated, it will run at the very minimum 1 more time.
| As a result, refs are _not_ set before a render effect runs for the first time. | ||
| - If multiple dependencies are updated within the same batch, the render effect only runs once. | ||
| - Effects always run after any pure computations (like [memos](/concepts/derived-values/memos)) in the same update cycle. | ||
| - The order in which render effects run is not guaranteed. |
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.
The order in which render effects run is not guaranteed.
I'd say
The order in which render effects run is not guaranteed after the initial ran.
Because, it's an eager effect, so the order on which is defined, it's the order on which runs. Only after it ran at least once the order stops being guaranteed.
This PR improves the
createEffectandcreateRenderEffectreference pages by:Any important notes removed from the reference pages (usually for Diataxis compliance) have been moved to an explanation page.