MSCDebouncer:
Filter:
mugic-spat-con/Classes (extension) | Libraries > MugicSpatCon

MSCDebouncer
ExtensionExtension

A utility for debouncing function calls

Description

MSCDebouncer allows the user to debounce function calls, ensuring that at least interval seconds pass between calls. This behaviour is useful to ensure that calls happen at the end of a series of events, such as for user input.

In the below example, a random amount of time less than one second) passes between each loop, and a function is debounced by 500ms (at least 500ms must pass between the debounce call and the function execution, often more).

MSCDebouncer is a part of the MugicSpatCon Quark.

Class Methods

.new

Instance Methods

.debounce

Wraps the function to debounce.

.interval

The minimum interval (in seconds) between debounced function calls.