MobX [v3.4.0-alpha.4] 發布,一個 TFRP 編程范式的實現

jopen 8年前發布 | 7K 次閱讀 MobX TFRP FRP

要想知道MobX是什么,首先需要了解一下FRP是什么,FRP 的本質是,在聲明一個值的時候,同時指定他的動態行為。這個值可能是事件,也可能是數據。 FRP 有兩個重要的分支:

  • 基于 Event Stream 的 FRP
    基于 Event Stream 的 FRP 擅長于管理 Stream,可進行 Joining, splitting, merging, mapping, sampling 等等。在需要處理多個 Event Stream 的時候非常有用,但對于簡單場景來說,就過于復雜了。比如 RxJS 和 BaconJS 就屬于此類。
     
  • Transparent FRP (TFRP)
    Transparent FRP 是在背后去實現 Reactive Programming 。和 Event Stream 的 FRP 一樣,TFRP 會在需要的時候更新 View,不同的是 TFRP 不需要你定義如何 (How) 以及何時 (When) 更新。這一類型的框架有 Meter(Tracker),knockoutJS 和 EmberJS 。

接下來介紹一下Mobx 和 其他實現有什么不同:

  • 同步執行 (這樣監聽的值始終是最新的,并且調試會方便,因為沒有額外的 Promise/Async 庫引入的堆棧信息)
  • 沒有引入額外的數據結構,基于普通的 Object, Class, Array 實現 (更少學習成本,更新數據時更自然)
  • 獨立方案 (不捆綁框架,相比 Meter, EmberJS 和 VueJS 而言)

更新日志

  • Fixed an issue preventing MGLAnnotationView from animating when its coordinate changes. Similarly, the user dot now animates between user locations when user tracking is disabled. (#6215)
  • predicate property on each MGLStyleLayer subclass allows you to access and modify the NSPredicate object that determines which source features are included in the layer. The predicate corresponds to the filter property in the stylesheet. (#6049)
  • Added options for clustering point features to MGLGeoJSONSource. (#6217)
  • Fixed an issue that caused the map to not update to reflect the centerOffset when the user location was tracked. (#6216)
  • Clarified that the -ObjC linker flag is required for linking against the static framework distribution of this SDK. (#6213)

下載

本站原創,轉載時保留以下信息:
本文轉自:深度開源(open-open.com)
原文地址:http://www.baiduhome.net/news/view/6fb9df48

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!