SmartReactives是Rx.NET的扩展,用来检测一个表达式的值是否有变化,通过IObservable接口来检测。简单的示例代码:
var iput = ew ReactiveVariable<it>(1);var square = ew ReactiveExpressio<it>(() => iput.Value * iput.Value);square.Subscribe(getSquare => Cosole.WriteLie("square = " + getSquare())); //Prits 'square = 1'iput.Value = 2; //Prits 'square = 4'iput.Value = 3; //Prits 'square = 9'SmartReactives灵感来自于Scala.Rx点击空白处退出提示
评论