From 2e509ad32c1288e66be2b2277836f256e410dfd8 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 1 Apr 2020 12:05:05 -0400 Subject: [PATCH] Don't do command batching if the batch is 0 items long --- tea.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tea.go b/tea.go index ef73717..923bffc 100644 --- a/tea.go +++ b/tea.go @@ -28,6 +28,9 @@ func CmdMap(cmd Cmd, model Model) Cmd { // Batch peforms a bunch of commands concurrently with no ordering guarantees // about the results. func Batch(cmds ...Cmd) Cmd { + if len(cmds) == 0 { + return nil + } return func(_ Model) Msg { return batchMsg(cmds) }