Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
1234567891011121314 |
- module.exports = debounce;
-
- function debounce(fn, ms) {
- if (ms == null)
- ms = 100;
-
- var timeout = null;
- return function() {
- if (timeout != null)
- clearTimeout(timeout);
-
- timeout = setTimeout(fn, ms);
- }
- }
|