@pengzhanbo/utils - v3.5.0
    Preparing search index...

    Interface ThrottleOptions

    Throttle Options

    interface ThrottleOptions {
        debounceMode?: boolean;
        noLeading?: boolean;
        noTrailing?: boolean;
    }
    Index

    Properties

    debounceMode?: boolean

    If debounceMode is true (at begin), schedule callback to execute after delay ms. If debounceMode is false (at end), schedule callback to execute after delay ms.

    如果 debounceMode 为 true(在开始时),则安排 callbackdelay 毫秒后执行。如果 debounceMode 为 false(在结束时), 安排 callbackdelay 毫秒后执行。

    noLeading?: boolean

    Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that callback will never executed if both noLeading = true and noTrailing = true.

    可选,默认为false。如果noLeading为false,第一次节流函数调用将立即执行回调。 如果noLeading为true,第一次回调执行将被跳过。 需要注意的是,如果noLeading = true且noTrailing = true,回调将永远不会被执行。

    noTrailing?: boolean

    Optional, defaults to false. If noTrailing is true, callback will only execute every delay milliseconds while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time after the last throttled-function call. (After the throttled-function has not been called for delay milliseconds, the internal counter is reset)

    可选,默认为false。如果noTrailing为true,回调函数仅在节流函数被调用时每delay毫秒执行一次。 如果noTrailing为false或未指定,回调函数将在最后一次节流函数调用后额外执行一次。 (当节流函数在delay毫秒内未被调用时,内部计数器将被重置)