forked from Mirrors/bubbletea
Short-ciruit the message loop when processing batched commands
This commit is contained in:
parent
cd63ed1e44
commit
4a41a61919
5
tea.go
5
tea.go
|
@ -212,10 +212,11 @@ func (p *Program) Start() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process batch commands
|
// Process batch commands
|
||||||
if b, ok := msg.(batchMsg); ok {
|
if batchedCmds, ok := msg.(batchMsg); ok {
|
||||||
for _, cmd := range b {
|
for _, cmd := range batchedCmds {
|
||||||
cmds <- cmd
|
cmds <- cmd
|
||||||
}
|
}
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
p.model, cmd = p.update(msg, p.model) // run update
|
p.model, cmd = p.update(msg, p.model) // run update
|
||||||
|
|
Loading…
Reference in New Issue