Skip to content
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

onSave not triggered if value evaluate to false #12

Closed
ockam opened this issue May 13, 2022 · 3 comments
Closed

onSave not triggered if value evaluate to false #12

ockam opened this issue May 13, 2022 · 3 comments

Comments

@ockam
Copy link

ockam commented May 13, 2022

In the useAutosave.tsx, when evaluating if onSave will be called, if the value is falsy (empty string, 0), onSave is not called.

    if (initialRender.current) {
      initialRender.current = false;
    } else if (debouncedValueToSave) {
      onSave(debouncedValueToSave);
    }

You should remove this check.

P.S. thanks for this great hook!

@jollyjerr
Copy link
Owner

This is great, thank you! I'll let you know when it's patched 🙇🏼

@jollyjerr
Copy link
Owner

closed by #14

@jollyjerr
Copy link
Owner

Patched in 0.4.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants