function debounced(duration) {
    return function(target, key, descriptor) {
        const baseFn = descriptor.value;
        throwIf(!isFunction(baseFn), '@debounced must be applied to a class method.');
        return {
            ...descriptor,
            value: function() {
                // synthesize an inner debounced function to the instance (not the class)
                const fn = getOrCreate(this, '_xh_' + key, () => debounce(baseFn, duration));
                fn.apply(this, arguments);
            }
        };
    };
}
/**
 * Decorates a class method so that it is debounced by the specified duration.
 * Based on https://github.com/bvaughn/debounce-decorator.
 *
 * @param {number} duration - milliseconds to debounce.
 */
Decorates a class method so that it is debounced by the specified duration.

@param {number} duration - milliseconds to debounce.
Decorates a class method so that it is debounced by the specified duration . @param { number } duration - milliseconds to debounce .
function debounced(duration) {
    return function(target, key, descriptor) {
        const baseFn = descriptor.value;
        throwIf(!isFunction(baseFn), '@debounced must be applied to a class method.');
        return {
            ...descriptor,
            value: function() {
                const fn = getOrCreate(this, '_xh_' + key, () => debounce(baseFn, duration));
                fn.apply(this, arguments);
            }
        };
    };
}
function debounced ( duration ) { return function ( target , key , descriptor ) { const baseFn = descriptor . value ; throwIf ( ! isFunction ( baseFn ) , '@debounced must be applied to a class method.' ) ; return { ... descriptor , value : function ( ) { const fn = getOrCreate ( this , '_xh_' + key , ( ) => debounce ( baseFn , duration ) ) ; fn . apply ( this , arguments ) ; } } ; } ; }
Decorates a class method so that it is debounced by the specified duration.
Decorates a class method so that it is debounced by the specified duration .
// synthesize an inner debounced function to the instance (not the class)