From 8b8fd1220149b8749a3704ce101eb31b2781a064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20L=C3=B3pez=20=28inkel=29?= Date: Mon, 3 Oct 2022 22:56:52 -0300 Subject: [PATCH] Update Program.Start docs to indicate it's a blocking operation This addresses one of the concerns in #299. --- tea.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tea.go b/tea.go index 0af2091..8669893 100644 --- a/tea.go +++ b/tea.go @@ -335,7 +335,9 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) { } } -// StartReturningModel initializes the program. Returns the final model. +// StartReturningModel initializes the program and runs its event loops, +// blocking until it gets terminated by either [Program.Quit], [Program.Kill], +// or its signal handler. Returns the final model. func (p *Program) StartReturningModel() (Model, error) { handlers := handlers{} cmds := make(chan Cmd) @@ -473,7 +475,9 @@ func (p *Program) StartReturningModel() (Model, error) { return model, err } -// Start initializes the program. Ignores the final model. +// Start initializes the program and runs its event loops, blocking until it +// gets terminated by either [Program.Quit], [Program.Kill], or its signal +// handler. func (p *Program) Start() error { _, err := p.StartReturningModel() return err