[feat]: Better events for SpringValue.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 29.1k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing SpringValue and useSpringValue behavior, then compare it with the to, set, and start APIs mentioned in the issue. Define the event surface and expected behavior for onChange and the other events before implementing it. Done means a SpringValue can be passed to subcomponents and observed directly without a wrapper or fake animated element.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100