map<Msg, inner> static method

Cmd<Msg> map<Msg, inner>(
  1. Cmd<inner> innerCmd,
  2. Msg f(
    1. inner
    )
)

Map a child Cmd to a parent Cmd.

Implementation

static Cmd<Msg> map<Msg, inner>(Cmd<inner> innerCmd, Msg Function(inner) f) =>
    Cmd(innerCmd._commands
        .map((Effect<inner> innerEffect) => (Dispatch<Msg> dispatch) =>
            innerEffect((inner x) => dispatch(f(x))))
        .toList());