<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          RxJSJavaScript 的 Reactive 擴(kuò)展

          聯(lián)合創(chuàng)作 · 2023-09-22 09:27

          ReactiveX 是一個通過使用可觀察序列來合成異步和基于事件的程序的庫。

          它擴(kuò)展了 observer 模式,以支持?jǐn)?shù)據(jù)和/或事件序列,并增加了操作符,允許你聲明式地將序列組合在一起,同時抽象出低級線程、同步、線程安全、并發(fā)數(shù)據(jù)結(jié)構(gòu)和非阻塞 I/O 等問題。

          示例代碼:

          var $input = $('#input'),
              $results = $('#results');
          
          /* Only get the value from each key up */
          var keyups = Rx.Observable.fromEvent(input, 'keyup')
              .map(function (e) {
                  return e.target.value;
              })
              .filter(function (text) {
                  return text.length > 2;
              });
          
          /* Now throttle/debounce the input for 500ms */
          var throttled = keyups
              .throttle(500 /* ms */);
          
          /* Now get only distinct values, so we eliminate the arrows and other control characters */
          var distinct = keyups
              .distinctUntilChanged();
          瀏覽 16
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  成年人视频免费 | 玖玖精品视频在线观看 | 懂色av蜜臀av粉嫩av | 91二区三区 | 桃色网站在线 |