Class Debounce<T>
java.lang.Object
com.levigo.jadice.web.client.util.Debounce<T>
- Type Parameters:
T
- The type of the user input.
Debounces user input.
Useful whenever there are frequent user input changes (e.g. slider input), to reduce emissions of value changes.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Function supplied from outside which will handle any user input emissions. -
Constructor Summary
-
Method Summary
-
Constructor Details
-
Debounce
- Parameters:
debounceTimeInMs
- The time to wait until emission.handler
- Function which handles the user input.
-
-
Method Details
-
next
Queue a value for emission.- Parameters:
t
- The value to emit, if no other value replaces it within the debounce time.
-