Add debounce and condition args to reactpy.event
#1341
Replies: 2 comments 1 reply
-
|
Debounce: This is lucky timing on my part, already on it. A few hours before you posted, I had committed Condition: Rather than a |
Beta Was this translation helpful? Give feedback.
-
|
The debounce addition sounds like a good improvement, especially for high-frequency events like onChange and onMouseMove, where sending every event to the backend can quickly become expensive. One possible consideration could be allowing both debounce and throttle strategies depending on the use case. Debounce works well for text inputs, while throttling might be more suitable for continuous interactions like mouse movement or scrolling. Handling some filtering on the client side before sending events to ReactPy could also help reduce unnecessary backend updates and improve perceived responsiveness. Looking forward to seeing how the customizable debounce implementation evolves. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have found that the biggest shortcoming to using ReactPy vs ReactJS is when it comes to rapidly firing events - such as onChange attached to a text input or onMouseMove on a large div. I had the idea of being able to either pass
debouce=<seconds>to a ReactPy event and/or pass a condition that can evaluate in javascript to determine whether the event should actually be sent to the ReactPy backend.Debounce example:
Condition example:
Any thoughts, concerns, or shortcomings?
Beta Was this translation helpful? Give feedback.
All reactions