Adds the debounce decorator#886
Adds the debounce decorator#886lllama wants to merge 1 commit intoTextualize:cssfrom lllama:debounce-decorator
Conversation
|
That is a nice solution! Don't think it belongs in events. I'd be tempted to put it in Are you up for the challenge of typing it? There's some recent extensions in typing to type decorators. |
|
I'll give it a go. There's potentially some similar ideas that might be useful (e.g. If that sounds useful, then is there a more generic place they could live? |
|
Update with an attempt at typing. Not sure if you prefer I also updated the dictionary example to use the decorator - happy to remove if that is a distraction. |
We add the debounce decorator in its own file and update the dictionary example to use it.
|
@lllama I think this is a great idea. Got some suggestions for improvements, which I will get to eventually! Could you PR against the main branch, which is where the action is now? |
The debounce decorator can be used to debounce calls to a method. In the below example, the decorator is used to debounce calls to
on_text_input_changedin the dictionary example app, which means that unnecessary network calls are not made.I don't know if this is the right file to put this but it seemed appropriate.