Replies: 2 comments
-
I've thought about making the useEffect close run on browser idle times to improve performance |
Beta Was this translation helpful? Give feedback.
0 replies
-
Smells like React and it's failures. Instead, copy Vue, which always takes what React has done, and then does it better:
You don't need to do all of these, or copy them exactly, but this is a million times better than prefixing something with "use" (ew). or the most generic thing ever "effect" (ugh). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I invite you to create together an expressive and predictable lifecycle for your web components created with Atomico
[email protected] component recycling has been introduced, which allows redoing hook state but not property state, recycling only happens:
Recycling is a utility to generate consistency with libraries that use this type of DOM manipulation, this also allows useEffect to be regenerated on recycle detection, example:
the above code is repetitive, I thought to simplify this by means of a new hooks called useMounted which would eliminate the need for the second parameter for useEffect, ideally this new hooks would alert the component what type of mounting is happening, either by recycling or by elimination .
Open questions
Do you think that the state of the hooks should be reset upon recycling?
Beta Was this translation helpful? Give feedback.
All reactions