-
Notifications
You must be signed in to change notification settings - Fork 807
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
Using tea.Printf before tea.Quit #413
Comments
This is a really good catch and, unfortunately, there's no solution yet. It may actually be possible to adjust |
Alright, so it still needs to be vetted, but I just pushed a cmd := tea.Sequence(tea.Println("A"), tea.Println("B"), tea.Println("C"), tea.Quit) Full example here. Would love hear what you think. |
It works great! I managed to run |
it is quite difficult to use the
tea.Printf
andtea.Println
functions right beforetea.Quit
.When using it with
tea.Batch
andtea.Quit
for example, there is a race betweentea.Printf
andtea.Quit
.Example:
By design
tea.Batch
doesn't provide any ordering guarantees, however its use withtea.Printf
andtea.Quit
makes it difficult to display all messages before quitting the program.(If I understand correctly, the tea.Print* example has the same issue, although it misses the first entry in the list (it's more visible if you deactivate the randomness of the packages function))
I tried with
tea.Sequentially
but it returns the first non-nil message, this ignores thetea.Quit
message.Ideally I would like to use
tea.Printf
, then once it's rendered, usetea.Quit
. Example:What is the proper way of using
tea.Printf
and thentea.Quit
?The text was updated successfully, but these errors were encountered: