forked from Mirrors/bubbletea
Fix more typos in examples (#102)
This commit is contained in:
parent
da9e8ee75a
commit
29b7de4b7c
|
@ -109,7 +109,7 @@ func (e example) helpView() string {
|
||||||
func main() {
|
func main() {
|
||||||
model, err := newExample()
|
model, err := newExample()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Could not intialize Bubble Tea model:", err)
|
fmt.Println("Could not initialize Bubble Tea model:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ type responseMsg struct{}
|
||||||
// Simulate a process that sends events at an irregular interval in real time.
|
// Simulate a process that sends events at an irregular interval in real time.
|
||||||
// In this case, we'll send events on the channel at a random interval between
|
// In this case, we'll send events on the channel at a random interval between
|
||||||
// 100 to 1000 milliseconds. As a command, Bubble Tea will run this
|
// 100 to 1000 milliseconds. As a command, Bubble Tea will run this
|
||||||
// asyncronously.
|
// asynchronously.
|
||||||
func listenForActivity(sub chan struct{}) tea.Cmd {
|
func listenForActivity(sub chan struct{}) tea.Cmd {
|
||||||
return func() tea.Msg {
|
return func() tea.Msg {
|
||||||
for {
|
for {
|
||||||
|
|
|
@ -41,7 +41,7 @@ func (m model) Init() tea.Cmd {
|
||||||
|
|
||||||
// Update is called when messages are received. The idea is that you inspect the
|
// Update is called when messages are received. The idea is that you inspect the
|
||||||
// message and send back an updated model accordingly. You can also return
|
// message and send back an updated model accordingly. You can also return
|
||||||
// a command, which is a function that peforms I/O and returns a message.
|
// a command, which is a function that performs I/O and returns a message.
|
||||||
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
switch msg.(type) {
|
switch msg.(type) {
|
||||||
case tea.KeyMsg:
|
case tea.KeyMsg:
|
||||||
|
|
Loading…
Reference in New Issue