node_modules/ant-design-vue/es/vc-select/hooks/useDelayReset.js
/**
 * Similar with `useLock`, but this hook will always execute last value.
 * When set to `true`, it will keep `true` for a short time even if `false` is set.
 */
Similar with `useLock`, but this hook will always execute last value.
Similar with ` useLock ` but this hook will always execute last value .
function useDelayReset() {
  var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
  var bool = ref(false);
  var delay;
  var cancelLatest = function cancelLatest() {
    clearTimeout(delay);
  };
  onMounted(function () {
    cancelLatest();
  });
  var delaySetBool = function delaySetBool(value, callback) {
    cancelLatest();
    delay = setTimeout(function () {
      bool.value = value;
      if (callback) {
        callback();
      }
    }, timeout);
  };
  return [bool, delaySetBool, cancelLatest];
}
function useDelayReset ( ) { var timeout = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 10 ; var bool = ref ( false ) ; var delay ; var cancelLatest = function cancelLatest ( ) { clearTimeout ( delay ) ; } ; onMounted ( function ( ) { cancelLatest ( ) ; } ) ; var delaySetBool = function delaySetBool ( value , callback ) { cancelLatest ( ) ; delay = setTimeout ( function ( ) { bool . value = value ; if ( callback ) { callback ( ) ; } } , timeout ) ; } ; return [ bool , delaySetBool , cancelLatest ] ; }
Similar with `useLock`, but this hook will always execute last value.
Similar with ` useLock ` but this hook will always execute last value .