loop

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 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 []Cmd

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, fn func() 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 Msg

type Msg any

type QuitMsg

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

type SequenceMsg

type SequenceMsg []Cmd

Jump to

Keyboard shortcuts

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