-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
feature request: throttle setting for autosave #29
Comments
onSubmit is just a function call and you can do your throttling within that function itself. in fact you can throttle, debounce, mix and match as you like. In fact that's a pattern I use extensively with uniforms. |
I agree with @serkandurusoy - you can do it by yourself, but I'll consider an |
@radekmie @zeroasterisk I think we should revisit this issue. We just hit a probem where, autosave combined with a debounce handler that wraps the forms submit handler creates a unique problem! When we have an array of strings or objects and "add" a new record on an "update" form where we provide a This causes different problems:
So, probably, the proper way to solve this problem would include:
What do you guys think? |
That's interesting, @serkandurusoy. I know it won't be doable within minutes, but could you create a repository (or at least a gist) with reproduction? That one for #22 was very useful. In spite of all - I'll try to come up with something. |
@radekmie I'll try to do that and if I can't I'll ask @guciek27 for help on that. In the meanatime, as an additional note to my solution suggestion: I think we can track "new array inputs";
|
Any progress? |
Hey, @guciek27, @serkandurusoy - any progress? I've tried to reproduce it but I didn't find out anything. |
@guciek27 I did not have time to work on simplifying your reproduction On Thu, Jun 30, 2016 at 7:07 PM, Radosław Miernik notifications@github.com
|
update - I've passed a throttled handler function down from container --> page --> AutoForm until internally supported // AutoForm.onSubmit handler
// gets all form values as an object
const handleSubmit = _.throttle((values, cb) => {
...
} though I still like the idea of it being internally throttled to some sane default, with a configuration option... just to simplify adoption. |
@zeroasterisk @serkandurusoy, @guciek27 |
When typing in a value, I don't want to autosave every character (when typing fast).
I'd like to wrap the autosave
onSubmit
with something like_.throttle(onSubmit, 2000)
The text was updated successfully, but these errors were encountered: