forked from Mirrors/bubbletea
More documentation edits
This commit is contained in:
parent
a5e38222c5
commit
17035473db
10
tea.go
10
tea.go
|
@ -48,11 +48,11 @@ func Batch(cmds ...Cmd) Cmd {
|
||||||
type Init func() (Model, Cmd)
|
type Init func() (Model, Cmd)
|
||||||
|
|
||||||
// Update is called when a message is received. Use it to inspect messages and,
|
// Update is called when a message is received. Use it to inspect messages and,
|
||||||
// in repsonse, update the model and/or send a command.
|
// in repsonse, update the model and/or send a command.
|
||||||
type Update func(Msg, Model) (Model, Cmd)
|
type Update func(Msg, Model) (Model, Cmd)
|
||||||
|
|
||||||
// View renders the program's UI: a string which will be printed to the
|
// View renders the program's UI, which is just a string. The view is rendered
|
||||||
// terminal. The view is rendered after every Update.
|
// after every Update.
|
||||||
type View func(Model) string
|
type View func(Model) string
|
||||||
|
|
||||||
// Program is a terminal user interface.
|
// Program is a terminal user interface.
|
||||||
|
@ -80,8 +80,8 @@ type quitMsg struct{}
|
||||||
// can send a batchMsg with Batch.
|
// can send a batchMsg with Batch.
|
||||||
type batchMsg []Cmd
|
type batchMsg []Cmd
|
||||||
|
|
||||||
// WindowSizeMsg is used to report on the terminal size. It's sent once
|
// WindowSizeMsg is used to report on the terminal size. Its sent to Update
|
||||||
// initially and then on every terminal resize.
|
// once initially and then on every terminal resize.
|
||||||
type WindowSizeMsg struct {
|
type WindowSizeMsg struct {
|
||||||
Width int
|
Width int
|
||||||
Height int
|
Height int
|
||||||
|
|
Loading…
Reference in New Issue