I'm trying to wrap these components into Vue component, which could provide better typescript hint.
Currently, I'm a little confuse about whether should I listen to events or just create a mutation observer, to watch the state changing?
Components like radio and checkbox provide change event, which generally give the choice to update the self-changing value (I mean, the value that may changed because of user clicking). However, collapsible doesn't provide event when user open or close it, and I have to use mutation observer to track the changing of open attribute.
Then, which one is suggested? Components like checkbox do have other reflected attributes (like focused), and it seems that using mutation observer is more robust.
I'm trying to wrap these components into Vue component, which could provide better typescript hint.
Currently, I'm a little confuse about whether should I listen to events or just create a mutation observer, to watch the state changing?
Components like radio and checkbox provide change event, which generally give the choice to update the self-changing value (I mean, the value that may changed because of user clicking). However, collapsible doesn't provide event when user open or close it, and I have to use mutation observer to track the changing of open attribute.
Then, which one is suggested? Components like checkbox do have other reflected attributes (like focused), and it seems that using mutation observer is more robust.