gre / multi-slider

React component for multiple values slider (allocate values)
http://gre.github.io/multi-slider
49 stars 31 forks source link

`onChange` only when user lifts handle #15

Closed ShukantPal closed 4 years ago

ShukantPal commented 5 years ago

I want to implement a feature where the parent component's onChange callback is invoked only when the user lifts the mouse from the handle. This makes computationally expensive renders stop, when the user doesn't need them.

nathanlogan commented 4 years ago

@SukantPal, you could use throttle or debounce to accomplish that.

ShukantPal commented 4 years ago

Throttle and denounce are different things. This feature would've called onChange only when the user is done interacting with the slider, not after every 200ms for example.

nathanlogan commented 4 years ago

@SukantPal, right. I was just talking about how to implement a version of what you were wanting to do (depending upon your specific requirements/context).