Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v2) Proposal: program execution flow #1136

Open
aymanbagabas opened this issue Sep 11, 2024 · 0 comments
Open

(v2) Proposal: program execution flow #1136

aymanbagabas opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@aymanbagabas
Copy link
Member

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.

@aymanbagabas aymanbagabas added the enhancement New feature or request label Sep 11, 2024
@aymanbagabas aymanbagabas added this to the v2.0.0 milestone Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants