<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>

          Yolk異步用戶(hù)界面構(gòu)建 JS 庫(kù)

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

          Yolk 是是構(gòu)建異步用戶(hù)界面的 JavaScript 庫(kù),基于 RxJSVirtual DOM。

          主要特性:

          • 熟悉:Yolk 大小約為  11kb minified + gzipped,基于 Virtual DOM 和 RxJS。

          • 一切都是可觀察的

          • 無(wú)狀態(tài)

          示例代碼:

          /** @jsx Yolk.createElement */
          import Yolk from `yolk`
          function Counter () {
            // map all plus button click events to 1
            const handlePlus = this.createEventHandler()
            const plusOne = handlePlus.map(() => 1)
            // map all minus button click events to -1
            const handleMinus = this.createEventHandler()
            const minusOne = handleMinus.map(() => -1)
            // merge both event streams together and keep a running count of the result
            const count = plusOne.merge(minusOne).scan((x, y) => x + y, 0).startWith(0)
            return (
              <div>
                <div>
                  <button id="plus" onClick={handlePlus}>+</button>
                  <button id="minus" onClick={handleMinus}>-</button>
                </div>
                <div>
                  <span>Count: {count}</span>
                </div>
              </div>
            )
          }
          Yolk.render(<Counter />, document.getElementById('container'))
          瀏覽 10
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <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>
                  日韩三级中文字幕电影在线 | A片黄色电影一级片 | 欧美精品乱人伦久久久久久 | 国产乱伦一级A片 | 久久久久久91亚洲精品中文字幕 |