在Flutter-redux中,我们可以使用onDidChange和onWillChange来检测存储状态的变化。但是,有没有一种方法可以检测特定属性的更改?
我可以做像这样的事情吗?
if(oldViewModel.changedProperty != viewModel.changedProperty)
在react-redux中,可以检查prevProps和currProps的差异,并根据差异执行操作。
发布于 2019-06-11 17:13:58
// As a performance optimization, the Widget can be rebuilt only when the
// [ViewModel] changes. In order for this to work correctly, you must
// implement [==] and [hashCode] for the [ViewModel], and set the [distinct]
// option to true when creating your StoreConnector.
StoreConnector<AppState, AppState>(
distinct: true,
converter: (store) => store.state,
builder: ),https://stackoverflow.com/questions/56419359
复制相似问题