map<Model, Msg> method
(Model, Cmd<Msg> )
map<Model, Msg>(
- Model mapperModel(
- InnerModel innerModel
- Msg mapperMsg(
- InnerMsg inner
This helper function can be used when going from a child update to a parent update.
Takes a function that returns the parent model from the child model, and a function that returns the parent message from the child message.
Implementation
(Model, Cmd<Msg>) map<Model, Msg>(
Model Function(InnerModel innerModel) mapperModel,
Msg Function(InnerMsg inner) mapperMsg) {
final (innerModel, innerCmd) = this;
return (mapperModel(innerModel), Cmd.map(innerCmd, mapperMsg));
}