Skip to content

Debounce

Tim Rücker edited this page Dec 6, 2018 · 1 revision

This decorator is meant for methods of a component. What debouncing is, can be read in this post.

This decorator takes as the first (and only) argument, the delay, which is used for the debounce function.

It can also be used in combination with the EventListener or GlobalEventListener Decorator, as long as it is declared first:

class MyComponent extends AbstractComponent {

	@Debounce(1000)//must be declared before the EventListener
	@EventListener()
	public click() {
		console.log('will just be triggered, when the user stops clicking for one second');
	}
}

Clone this wiki locally