vue-ts-debounce

Vue.js decorator for debouncing
3,599 4
Install
npm install vue-ts-debounce
Latest Version:0.1.2
Vue:2
License:MIT
Last Updated:Mar 23, 2026
Links: GitHub  ·  npm
Maintainer: rubengees

vue-ts-debounce

Debounce decorator for Vue.js 2 using vue-class-component. Based on ts-debounce.

Install

yarn add vue-ts-debounce

Usage

In the example below, increment is called at most every 500ms.


<template>
  <span>{{ value }}</span>
</template>

<script lang="ts">
import Vue from "vue"
import Component from "vue-class-component"
import { Debounce } from "vue-ts-debounce"

@Component
export default class MyComponent extends Vue {
  value = 0

  @Debounce(500)
  increment() {
    this.value += 1
  }
}
</script>

Options

The @Debounce decorator either accepts a number or an object. The number represents the wait time in ms between each call. The following options are available in the object:

Name Description
wait The wait time in ms.
isImmediate If the first call should be immediate instead of waiting for the given duration.
maxWait Call debounced function after this duration in ms, even if another call is currently in progress.

Thanks

Inspired by vue-debounce-decorator. The difference to that library is the usage of ts-debounce and the ability to use the decorator across multiple instances of the same component.

Related Packages

tiny-debounce

tiny debounce function alternative to lodash.debounce

953,243
vue-debounce-component

debounce directive for vue 2.x.x.

1,537 0
vue-debounce-decorator

Debounce methods in vue class components

163,036 22
vue-click

Vue plugin for advanced click directive.

18,512 33
vue-lazy-input

A VueJs directive for lazily binding @input events

1,835 0

Version History

Version Released Vue License
0.1.2 ^2.0.0 MIT
0.1.1 ^2.0.0 MIT
0.1.0 ^2.7.14 MIT