Skip to content

(v2) Proposal: program execution flow #1136

Closed
@aymanbagabas

Description

@aymanbagabas

Currently, Bubble Tea programs has the following methods to start and run a program.

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.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions