
要想知道MobX是什么,首先需要了解一下FRP是什么,FRP 的本质是,在声明一个值的时候,同时指定他的动态行为。这个值可能是事件,也可能是数据。 FRP 有两个重要的分支:
接下来介绍一下Mobx 和 其他实现有什么不同:
observable.object(props, name?) creates a new observable object, by cloning the give props and making them observableobservable.array(initialValues, name?). Take a guess..observable.map(initialValues, name?)observable.box(initialValue, name?). Creates a boxed value, which can be read from / written to using .get() and.set(newValue)observable(value), as-is, based on the type of value, uses any of the above four functions to create a new observable.observable.shallowObject(props, name?)observable.shallowArray(initialValues, name?)observable.shallowMap(initialValues, name?)observable.shallowBox(initialValue, name?)
本站原创,转载时保留以下信息:
本文转自:深度开源(open-open.com)
原文地址:http://www.open-open.com/news/view/3726e4be