mutate<Model extends BaseUIModel> method
Model
mutate<Model extends BaseUIModel>(
- Model defaultModel,
- void f(
- Model m
- bool overwrite = false
Modifies the data of the model of type BaseUIModel stored the store
The key used for the model must be guaranteed as unique by the developer
across the whole app. Setting overwrite
to true forces mutate not to
reuse any portion of the Model
in the Store.
Implementation
@override
Model mutate<Model extends BaseUIModel>(
Model defaultModel, void Function(Model m) f,
[bool overwrite = false]) {
var d = overwrite ? defaultModel : read(defaultModel).clone();
f(d);
return d;
}