-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<Pace>
does not respect getPace
prop when ms={undefined|null}
#48
Comments
Update: I tried an alternative solution, roughly speaking: const getPace = React.useCallback((char: string) => {
const defaultPace = windups.defaultGetPace(char, undefined);
return isInFastMode ? (defaultPace / 50) : defaultPace;
}, [isInFastMode]);
// ... later
<windups.WindupChildren>
<windups.Pace getPace={getPace}>
this is a lot of text that a user might fast-mode through
</windups.Pace>
</windups.WindupChildren> This unfortunately doesn't work—I'm guessing the original callback prop is getting cached somewhere and never swaps in the new one?—but the diff to support Edit: lol, guess not. I'm having the same "persisted prop" issue when toggling between |
Always nice to see a familiar face. The use-case you're describing is one I definitely see the need for and think windups should support. But... I think it might not be possible with this version of Windups. It's about how Windups deal with equivalence. You're bumping into a version of this problem. Here's the relevant part:
This is a caveat I had to accept to make WindupChildren's API possible. It stems from the identity of the Now if you did what the frog suggests and change the Now this is where the unreleased version 2 that's been sitting on the shelf completely unloved by me comes in: it has a By the way: thank you for contributing to this repo. I'm heads down with a funded OSS project that leaves me very little time for anything else, and it annoys me that I have all this new windups stuff lying around simply because I can't together the time to write docs for it. |
😂 Lol, I hear you; I've had many fun projects linger on shelves too. Yes this is definitely an incentive to migrate to Rewindups! How do you suggest I hop on? And no worries about the time / availability thing. I am very incentivized to get this working, so if you can even point me to the v2 code I'd be happy to fiddle around in there and help you get the docs release-ready. |
Hey Sam! Sending you a gentle + compassionate nudge on this thread—I appreciate that your focus is elsewhere! I tried to look through the branches published on Github and can't find the "prerelease" source anywhere. If you could please |
Thanks for your patience. I'll get round to pushing up a branch, in the meantime there is a release on NPM you can try:
|
Alas, unless that version supports the new No worries mate, I can keep waiting. You did such a great job with this lib already, this is just a minor UX quibble from some of my testers 😄 |
Hello! Me again 😅
I was wondering if there's a story behind your use of
'ms' in props
over in Pace.tsx.Specifically, I'm trying to add a "hold button to speed up"-style UX to my windup, and when in this mode would like to use a pace of 4ms per character; meanwhile when I'm not in this mode I'm hoping to use the
defaultGetPace
implementation. Intended usage looks something like:Is this another contrib I can help with?
The text was updated successfully, but these errors were encountered: