Replies: 1 comment 2 replies
-
Thanks for the feedback! Do you think it would be helpful to maybe amend the commands tutorial to point to some of our examples of different data types being used as Something like:
Where we would include links to examples using these different data types. Let us know your thoughts! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the "Commands in Bubble Tea" tutorial, the demonstration
checkServer()
function returns:I read that tutorial page a few times, and sadly for me, it wasn't obvious to me that
statusMsg
could be a struct and thus I could easily asynchronously return multiple values.After seeing @bashbunni 's video and more importantly, reviewing the code in the project that goes with the video, I saw:
pjs/tui/projectui/model.go
and then later:
pjs/tui/projectui/commands.go
Of course
tea.Msg
is defined in tea.go as:type Msg interface{}
, so I get it now.I realize that you kind of address this in the following section on Cmds "One More Thing About Commands" but even the "a more real-world example" is still returning an int rather than a struct.
Similar issue in the
return someMsg{id: id}
example... If you had shown the definition ofsomemsg
I would have put it together.For some reason, even when I read:
In my mind, I read that as "can be any simple type". It would have helped me if a little more verbose, explicitly using words from go syntax like:
Thanks for taking the time to read this. Not trying to criticize. The tutorial is very helpful. Just hopefully some feedback that may make the tutorial even more useful for people coming from other languages.
Beta Was this translation helpful? Give feedback.
All reactions