React-redux-form: Feature: debouncing!

Created on 21 Dec 2016  路  6Comments  路  Source: davidkpiano/react-redux-form

This is a placeholder issue for adding debounce functionality for form controls.

Still figuring out the API for this. :thinking: If you have suggestions, feel free to list them here!

I want to make this as unopinionated and flexible as possible, including but not limited to:

  • debounce time in milliseconds
  • trailing or leading debounce (--x----x vs. x--x---x)
  • throttling instead of debouncing
  • custom scheduling (think only changing on requestAnimationFrame, or at a custom interval)

(this is getting pretty reactive!)

enhancement

Most helpful comment

I decided to ship an MVP API for this that is as simple as humanly possible and covers 97% of use cases:

<Control model="user.name" debounce={300} />

The viewValue will always be updated immediately, but the model value will be debounced properly.

All 6 comments

I decided to ship an MVP API for this that is as simple as humanly possible and covers 97% of use cases:

<Control model="user.name" debounce={300} />

The viewValue will always be updated immediately, but the model value will be debounced properly.

@davidkpiano I was trying a use case where I wanted to delay the value when using a parser. That way if i was doing a date for instance and replacing every two characters with a / it would work when backspacing. The debounce does not appear to work with the parse method.

@greghawk Can you spin up an example that replicates the issue?

I can. Pretty simple though

Awesome, want to file another issue? I'll take care of it soon.

Great! I can do that. I had talked to you before about parsers/formatters and you mentioned race conditions. I think if we can get debounce working on parsers things like currency, date and masking things may be possible with the right debounce setting. Also i noticed the docs mentioned that the parser prop has an optional "previous" param. I don't see this ever getting hydrated and in the most recent build i don't see anything passing it either in the source code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vladshcherbin picture vladshcherbin  路  5Comments

dstudzinski picture dstudzinski  路  3Comments

davidspiess picture davidspiess  路  5Comments

varzock picture varzock  路  3Comments

Jokinen picture Jokinen  路  3Comments