UNPKG

balm-ui

Version:

A modular and customizable UI library based on Material Design and Vue 3

1 lines 1.03 kB
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define("vDebounce",[],t):"object"===typeof exports?exports.vDebounce=t():e.vDebounce=t()}("undefined"!==typeof self?self:this,(function(){return function(){"use strict";var e={d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return c}});const o=/(?:^\[object\s(.*?)\]$)/;var n=e=>Object.prototype.toString.call(e).replace(o,"$1").toLowerCase();var c={name:"debounce",mounted(e,t){let{value:o}=t;if("object"!==n(o))throw new Error("[v-debounce]: The 'value' must be an object ({ callback: Function, delay?: number })");{const{callback:t,delay:c}=o;let r;"function"!==n(t)&&console.warn("[v-debounce]: The 'callback' must be a function"),e.addEventListener("click",(()=>{r&&clearTimeout(r),r=setTimeout((()=>{t()}),c||250)}))}}};return t=t.default}()}));