You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To keep the API similar to other Go packages, we could change the API to be as follows:
Start() error starts the program and event loop
Wait() error waits for the event loop to finish and exit
Run() error becomes a helper that starts and waits for the program
Kill() error kills the program and forces the event loop to stop
With this, we would expose a program.Model that has the final model after the program exits. During the lifetime of the program, program.Model would be nil. This is similar to the exec.Cmd API in the standard library.
The text was updated successfully, but these errors were encountered:
Currently, Bubble Tea programs has the following methods to start and run a program.
Start() error
starts the program and waits without returning a final model deprecatedRun() (Model, error)
starts the program and waitsWait()
waits for the program to finish (the aforementioned ones already wait for the program to exit, this is redundant)Kill()
kills the program (currently it only cancels the context) Related issues: Recover panics from within cmds goroutines #234 After a panic() the terminal input does not show #1127To keep the API similar to other Go packages, we could change the API to be as follows:
Start() error
starts the program and event loopWait() error
waits for the event loop to finish and exitRun() error
becomes a helper that starts and waits for the programKill() error
kills the program and forces the event loop to stopWith this, we would expose a
program.Model
that has the final model after the program exits. During the lifetime of the program,program.Model
would benil
. This is similar to theexec.Cmd
API in the standard library.The text was updated successfully, but these errors were encountered: