-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Description:
- A-Frame Version: 1.3.0
- Platform / Device: All
- Reproducible Code Snippet or URL: N/A
Since 1.3.0, we have a new utility function:
AFRAME.utils.throttleComponentChanged
This was introduced by PR #4980 to solve #4972
This truns out to be a generically useful utility function, but it doesn't have a generic name.
Recently in an A-Frame app I wanted to do exactly the same thing with the objectChange event from THREE.TransformControls.
But using a utility function called throttleComponentChanged to do a debounced throttle on an event called objectChange could have been confusing...!
I propose renaming this utility function to a name that reflects it's generic capability, namely to debounce an event in a throttled manner, which puts a cap on the rate at which the event fires, but also guarantees a correct end state.
My suggested name is AFRAME.utils.throttledDebounce
I'd be happy to do the PR to do all of this, assuming I can get agreement this is a good idea.
I expect we need to keep AFRAME.utils.throttleComponentChanged for back compatibility, but it can just be mapped to AFRAME.utils.throttledDebounce.