[feat]: Better events for SpringValue.
A clear and concise description of what the feature is
const springV = useSpringValue(0);
springV.onChange((v) => console.log(`val now be ${v}`));
Just like a to function but always request value and return nothing. And same for other events.
Why should this feature be included?
It can help to share a SpringValue to others by pass in props. Now, I can only add listener at useSpringValue.
Please provide an example for how this would work
Im trying to pass a SpringValue called seed (witch computed by mousemove) to Subcomponents, and each Subcomponents owned a SpringValue called ans.
Normally ans should be computed by seed (like using to instead a useSpringValue). But when I drag a Subcomponent, it must return to oraginal status and folow my dragging.
So I can only use .set and .start in to function to set seed value to ans and put return on a fake animad.div.
How my animation look like
https://github.com/user-attachments/assets/93acf4c4-05d0-4c36-b629-88a554bd44de
And TBH, I use useSpringValue much much more than useSpring or others. I do think SpringValue should be the major hero feature, not useSpirng.