Menu icon Foundation
Foundation 6 debounce

Hi guys,

Quick one...hopefully. In F5 there was a utility called Foundation.utils.debounce which was very useful. It seems to have been removed from F6. Is there a built in utility in Foundation 6 that will do the same job?

Cheers,

Will

F6foundation 6debounce

Hi guys,

Quick one...hopefully. In F5 there was a utility called Foundation.utils.debounce which was very useful. It seems to have been removed from F6. Is there a built in utility in Foundation 6 that will do the same job?

Cheers,

Will

Rafi Benkual over 3 years ago

It's in the foundation.js file now.

Foundation.util = {
  /**
   * Function for applying a debounce effect to a function call.
   * @function
   * @param {Function} func - Function to be called at end of timeout.
   * @param {Number} delay - Time in ms to delay the call of `func`.
   * @returns function
   */

How are you using it?

Chris over 3 years ago

Rafi: If you had copied the very next line, you would see that this is the throttle function, which is not the same a debounce. Debounce does seem to be missing.

Chris over 3 years ago

Rafi: If you had copied the very next line, you would see that this is the throttle function, which is not the same a debounce. Debounce does seem to be missing.

Ondřej Vašíček over 3 years ago

I'm also missing these two functions. It seems like there are more things which disappeared from F6 without explanation or workaround.

I know there are ‘triggers’ but what I understand from the example, it’s only good for scrolling and resizing. The debounce and throttle featureswere amazing and we could use them on anything what changes too fast.

Is there any chance you put them back?

 

Thanks for answer and your work in general. I really like F6.