Documentation
¶
Index ¶
Constants ¶
View Source
const EventTypeAbort = "abort"
Variables ¶
This section is empty.
Functions ¶
func AbortContext ¶ added in v0.8.0
func AbortContext(ctx context.Context, signal *AbortSignal) context.Context
AbortContext will listen to abort events from an AbortSignal. The return value is a child context of ctx which will be cancelled if a, abort event is dispatched before the parent context cancels.
If the context is cancelled due to an abort event, the abort reason can be used as the cancel cause, which can be read using context.Cause. If the cause is not an error type, an [ErrAny] will be returned.
Types ¶
type AbortController ¶ added in v0.8.0
type AbortController struct {
// contains filtered or unexported fields
}
func NewAbortController ¶ added in v0.8.0
func NewAbortController() *AbortController
func (*AbortController) Abort ¶ added in v0.8.0
func (c *AbortController) Abort(reason any)
func (*AbortController) Signal ¶ added in v0.8.0
func (c *AbortController) Signal() *AbortSignal
type AbortSignal ¶ added in v0.8.0
type AbortSignal struct { event.EventTarget // contains filtered or unexported fields }
func (AbortSignal) Aborted ¶ added in v0.8.0
func (s AbortSignal) Aborted() bool
func (AbortSignal) Onabort ¶ added in v0.8.0
func (s AbortSignal) Onabort() event.EventHandler
func (AbortSignal) Reason ¶ added in v0.8.0
func (s AbortSignal) Reason() any
func (AbortSignal) SetOnabort ¶ added in v0.8.0
func (s AbortSignal) SetOnabort(event.EventHandler)
func (AbortSignal) ThrowIfAborted ¶ added in v0.8.0
func (s AbortSignal) ThrowIfAborted() error
type ChildrenRenderer ¶
ChildrenRenderer is the interface for DOM types that have children that can be rendered.
ChildrenRenderer is used for generating HTML and TextContent from DOM nodes.
Click to show internal directories.
Click to hide internal directories.