loop

package
v1.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchMsg

type BatchMsg struct {
	IsMsg
	// contains filtered or unexported fields
}

type Cmd

type Cmd func() Msg

func Batch

func Batch(cmds ...Cmd) Cmd

func Quit

func Quit(err error) Cmd

func Sequence

func Sequence(cmds ...Cmd) Cmd

func Tick added in v1.3.6

func Tick(delay time.Duration, msg Msg) Cmd

type EventLoop

type EventLoop struct {
	// contains filtered or unexported fields
}

func NewEventLoop

func NewEventLoop(updateFunc func(msg Msg) Cmd) EventLoop

func (*EventLoop) Run

func (l *EventLoop) Run(ctx context.Context, initCmd Cmd) (err error)

func (*EventLoop) Send

func (l *EventLoop) Send(msg Msg)

type IsMsg added in v1.13.0

type IsMsg struct{}

type Msg

type Msg interface {
	// contains filtered or unexported methods
}

func NewQuitMsg added in v1.5.3

func NewQuitMsg(err error) Msg

type QuitMsg

type QuitMsg struct {
	IsMsg
	// contains filtered or unexported fields
}

type SequenceMsg

type SequenceMsg struct {
	IsMsg
	// contains filtered or unexported fields
}

type TickMsg added in v1.13.0

type TickMsg struct {
	IsMsg
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL