Documentation
¶
Overview ¶
Package testkit contains Effects and Session construction helpers for Flatte's in-repository harnesses and samples. It is not part of the public module API.
Index ¶
- func NewHarnessEffects[S any](ctx context.Context, updates chan<- flatte.StateUpdate[S], quit func(), ...) flatte.Effects[S]
- func NewHarnessEffectsQueue[S any](ctx context.Context, enqueue func(flatte.StateUpdate[S]) bool, quit func(), ...) flatte.Effects[S]
- func NewHarnessEffectsWithServices[S any](ctx context.Context, updates chan<- flatte.StateUpdate[S], ...) flatte.Effects[S]
- func SettleFrame(view func() flatte.Frame, handle func(flatte.LayoutEvent), ...) (flatte.Frame, layout.Composition, map[string]layout.Rect)
- func WithHostMedia(commands <-chan flatte.MediaEvent, publish func(*flatte.NowPlaying)) flatte.Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHarnessEffects ¶
func NewHarnessEffects[S any](ctx context.Context, updates chan<- flatte.StateUpdate[S], quit func(), dispatch func(func()), clock flatte.Clock) flatte.Effects[S]
NewHarnessEffects creates Effects that send updates to updates. Async work uses dispatch (nil means a real goroutine) and clock (nil means real time).
func NewHarnessEffectsQueue ¶
func NewHarnessEffectsQueue[S any](ctx context.Context, enqueue func(flatte.StateUpdate[S]) bool, quit func(), dispatch func(func()), clock flatte.Clock) flatte.Effects[S]
NewHarnessEffectsQueue creates Effects backed by an enqueue callback.
func NewHarnessEffectsWithServices ¶
func NewHarnessEffectsWithServices[S any](ctx context.Context, updates chan<- flatte.StateUpdate[S], send func(context.Context, any) bool, quit func(), dispatch func(func()), clock flatte.Clock, services flatte.HostServices) flatte.Effects[S]
NewHarnessEffectsWithServices is NewHarnessEffects with host services installed on the returned Effects value.
func SettleFrame ¶
func SettleFrame(view func() flatte.Frame, handle func(flatte.LayoutEvent), last map[string]layout.Rect, width, height int) (flatte.Frame, layout.Composition, map[string]layout.Rect)
SettleFrame uses the root runtime's private cell-layout settling path.
func WithHostMedia ¶
func WithHostMedia(commands <-chan flatte.MediaEvent, publish func(*flatte.NowPlaying)) flatte.Option
WithHostMedia constructs the internal media option used by the browser smoke and native composite host.
Types ¶
This section is empty.