Documentation
¶
Overview ¶
Package flash provides state management for transient status messages in Bubble Tea applications.
A typical TUI shows a brief "Approved #123" or "Error: ..." message that auto-clears after a few seconds. Both the message and a monotonic ID are tracked so that stale ClearMsg ticks never wipe a newer message.
The package is pure state - the application owns the [tea.Tick] scheduling and the rendering. flash only manages the set/clear lifecycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClearMsg ¶
type ClearMsg struct {
// contains filtered or unexported fields
}
ClearMsg is sent after the flash duration expires. Pass it to State.Clear in the application's Update loop.
type State ¶
State tracks a transient status message with expiry.
func (*State) Clear ¶
Clear resets the flash only when the ClearMsg ID matches the current flash. A stale clear (from an earlier Set) is silently ignored.