forked from Mirrors/bubbletea
Don't do command batching if the batch is 0 items long
This commit is contained in:
parent
1bf93b1ccf
commit
2e509ad32c
3
tea.go
3
tea.go
|
@ -28,6 +28,9 @@ func CmdMap(cmd Cmd, model Model) Cmd {
|
||||||
// Batch peforms a bunch of commands concurrently with no ordering guarantees
|
// Batch peforms a bunch of commands concurrently with no ordering guarantees
|
||||||
// about the results.
|
// about the results.
|
||||||
func Batch(cmds ...Cmd) Cmd {
|
func Batch(cmds ...Cmd) Cmd {
|
||||||
|
if len(cmds) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return func(_ Model) Msg {
|
return func(_ Model) Msg {
|
||||||
return batchMsg(cmds)
|
return batchMsg(cmds)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue