@cnamts/vue-dot
Version:
Implementation of our Design System for the French Health Insurance
15 lines (10 loc) • 414 B
text/typescript
import { DirectiveOptions } from 'vue';
import { getInputElement, getInputHandler, getTimeModifier } from './core';
export const debounce: DirectiveOptions = {
bind(el, { modifiers, value }) {
const inputElement = getInputElement(el);
const time = getTimeModifier(modifiers);
const inputHandler = getInputHandler(inputElement, value, time);
inputElement.addEventListener('input', inputHandler);
}
};