From 4a41a619192a5bcce84e64c608ab7ba9a328b6b9 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 3 Apr 2020 18:31:40 -0400 Subject: [PATCH] Short-ciruit the message loop when processing batched commands --- tea.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tea.go b/tea.go index c425a1e..e71da98 100644 --- a/tea.go +++ b/tea.go @@ -212,10 +212,11 @@ func (p *Program) Start() error { } // Process batch commands - if b, ok := msg.(batchMsg); ok { - for _, cmd := range b { + if batchedCmds, ok := msg.(batchMsg); ok { + for _, cmd := range batchedCmds { cmds <- cmd } + continue } p.model, cmd = p.update(msg, p.model) // run update