Skip to content

Commit

Permalink
docs: update godoc examples to return model in Init
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Sep 19, 2024
1 parent a7d49d0 commit 265996c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
//
// Example:
//
// func (m model) Init() Cmd {
// return tea.Batch(someCommand, someOtherCommand)
// func (m model) Init() (Model, Cmd) {
// return m, tea.Batch(someCommand, someOtherCommand)
// }
func Batch(cmds ...Cmd) Cmd {
var validCmds []Cmd //nolint:prealloc
Expand Down Expand Up @@ -78,9 +78,9 @@ type sequenceMsg []Cmd
// })
// }
//
// func (m model) Init() Cmd {
// func (m model) Init() (Model, Cmd) {
// // Start ticking.
// return tickEvery()
// return m, tickEvery()
// }
//
// func (m model) Update(msg Msg) (Model, Cmd) {
Expand Down Expand Up @@ -132,9 +132,9 @@ func Every(duration time.Duration, fn func(time.Time) Msg) Cmd {
// })
// }
//
// func (m model) Init() Cmd {
// func (m model) Init() (Model, Cmd) {
// // Start ticking.
// return doTick()
// return m, doTick()
// }
//
// func (m model) Update(msg Msg) (Model, Cmd) {
Expand Down Expand Up @@ -164,9 +164,9 @@ type setWindowTitleMsg string
//
// For example:
//
// func (m model) Init() Cmd {
// func (m model) Init() (Model, Cmd) {
// // Set title.
// return tea.SetWindowTitle("My App")
// return m, tea.SetWindowTitle("My App")
// }
func SetWindowTitle(title string) Cmd {
return func() Msg {
Expand Down

0 comments on commit 265996c

Please sign in to comment.