Bloomca / veles

UI library with main focus on performance
https://bloomca.github.io/veles/
MIT License
40 stars 0 forks source link

fix incorrect unmount behaviour with usevalue logic #56

Closed Bloomca closed 3 weeks ago

Bloomca commented 3 weeks ago

Description

I accidentally discovered that useValue uses an incorrect logic to replace childComponents array, which led to some onUnmount callbacks being called multiple times (and others potentially never).

Another thing here is that we reverse the onUnmount calls, this way we unmount children first, and parent after that, which should be more logical. I don't use it anywhere, and in general it is common not to guarantee the execution order for such things, but I think it makes more sense. It might change in the future if I add promises support to components.