new lifecycle (beforeCleanup) proposal #1761
gabrielmfern
started this conversation in
Ideas
Replies: 1 comment 8 replies
-
Components do not have lifecycles, these are regular effects, people call them lifecycle for some reason. In overall Don't expect out of the box solution for specific problems. There are many ways to address the issue you describe in #1757, just read the docs and work out the examples. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have noticed that the onCleanup does not run exactly at the moment that the cleaning up process starts due to children components
needing to be cleaned up before the component itself. This make it kinda hard to work in the situation I am in right now.
I am creating a UI library for Solid and I need to delete the Form's field's value if the field by itself is being cleaned up, but if the field is being cleaned due to the parent being cleaned it should not delete the field's value.
This is quite simple logic, and to resolve it I propose that we have a new lifecycle that can be used that runs just before the
clean up of the component's children. It can be called
beforeCleanup
or similar. Its usage would be the same as foronCleanup
.Beta Was this translation helpful? Give feedback.
All reactions