batch static method

Cmd batch(
  1. List<Cmd> commands
)

A command that runs multiple commands concurrently.

All commands start executing immediately. Each command's message is delivered as soon as that command finishes — without waiting for the others.

For sequential execution use Cmd.sequence instead.

return (newModel, Cmd.batch([
  loadModel(),
  Cmd.tick(Duration(milliseconds: 100), (_) => TickMsg()),
]));

Implementation

static Cmd batch(List<Cmd> commands) {
  if (commands.isEmpty) return none();
  if (commands.length == 1) return commands.first;
  return ParallelCmd(commands);
}