Auto store and reload data input

For my web app I like that user’s input is continuously saved without users having to click “save” or “post” button.

The solution that I have is as following:

I have an input text field that uses dmx-bind:value and loads text from the DB (if there are). I also have a dmx-on:changed that adds the updated text to the DB.
The SC that is triggered by the dmx-changed includes on:success to reload the DB to ensure that the data is reloaded into the text field in case users go to a different page and come back.

This works fine, when users type slow. Yet when users type fast, half the text gets losts because of the reload functionality.

How can I best improve my set up?

Have a look at Debounce on the value changed dynamic event. It is a value in milliseconds that will delay the action.

So if the debounce is 500, it will not execute the action until a half second of no changes.

2 Likes

thanks, as simple as that :slight_smile: