dispatchModel<Model extends BaseUIModel> method
Future<void>
dispatchModel<Model extends BaseUIModel>(
- Model defaultModel,
- void f(
- Model m
- [bool overwrite = false]
override
Sends an anonymous action given the data of a model of type BaseUIModel
The key used for the model must be guaranteed as unique by the developer
across the whole app. Setting overwrite
to true forces dispatchModel not to
reuse any portion of the Model
in the Store.
Implementation
@override
Future<void> dispatchModel<Model extends BaseUIModel>(
Model defaultModel, void Function(Model m) f,
[bool overwrite = false]) async =>
await super.dispatch!(BaseAction.build({
defaultModel.$key: mutate(defaultModel, f, overwrite),
}));