<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## throttle + [link](./throttle "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L9172 "View in source.") + [npm](https://www.npmjs.com/package/lodash.throttle "See the npm package.") ``` _.throttle(func, [wait=0], [options]) ``` 創建一個節流函數,在 `wait` 秒內最多執行 `func` 一次的函數。 該函數提供一個 cancel 方法取消延遲的函數調用以及 flush 方法立即調用。 可以提供一個 options 對象決定如何調用 func 方法, options.leading 與|或 options.trailing 決定 `wait` 前后如何觸發。 func 會傳入最后一次傳入的參數給這個函數。 隨后調用的函數返回是最后一次 func 調用的結果。 **注意:** 如果 leading 和 trailing 都設定為 true。 則 func 允許 trailing 方式調用的條件為: 在 wait 期間多次調用。 查看 [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) 了解 `_.throttle` 與 `_.debounce` 的區別 ### 參數 1. func (Function) 要節流的函數 2. [wait=0] (number) 需要節流的毫秒 3. [options] (Object) 選項對象 4. [options.leading=true] (boolean) 指定調用在節流開始前 5. [options.trailing=true] (boolean) 指定調用在節流結束后 ### 返回值 (Function) 返回節流的函數 ### 示例 ``` // 避免在滾動時過分的更新定位 jQuery(window).on('scroll', _.throttle(updatePosition, 100)); // 點擊后就調用 `renewToken`,但5分鐘內超過1次。 var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); jQuery(element).on('click', throttled); // 取消一個 trailing 的節流調用 jQuery(window).on('popstate', throttled.cancel); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看