本次更新内容增强模型的订阅模块,写法更简洁,同时拥有typescript自动类型推导 class Test extends Model<Data> { protected subscribers(): RM.Subscriber<Data> { return [ // So amazing, the parameter state and action have type checking automatically. otherModel.action.onSuccess((state, action) => { return state; }); ]; } }
如果你还在用函数式写法去写redux的action、types、reducer,那么你有必要往下看。这个框架对redux进行了一次彻头彻尾的面向对象封装,让你用最少的代码做最多的事情。 对比
本模型库在使用ts的情况下,你将得到100%无死角的静态类型提示。 |