Documentation
¶
Index ¶
- func EmptyPayload() printer.Payload
- type Done
- type Door
- func (d *Door) DeferredInner(ctx context.Context, content any) <-chan error
- func (d *Door) DeferredOuter(ctx context.Context, outer any) <-chan error
- func (d *Door) DeferredStatic(ctx context.Context, content any) <-chan error
- func (d *Door) Inner(ctx context.Context, content any) <-chan error
- func (d *Door) Main() gox.Elem
- func (d *Door) Outer(ctx context.Context, outer any) <-chan error
- func (d *Door) Proxy(cur gox.Cursor, el gox.Elem) error
- func (d *Door) Reload(ctx context.Context) <-chan error
- func (d *Door) Static(ctx context.Context, content any) <-chan error
- func (d *Door) Unmount(ctx context.Context) <-chan error
- type Instance
- type Pipe
- type Root
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyPayload ¶ added in v0.10.0
Types ¶
type Door ¶
type Door struct {
// contains filtered or unexported fields
}
Door renders content that can be updated, replaced, or removed after render.
func (*Door) DeferredInner ¶ added in v0.17.0
DeferredInner is the same as Door.Inner, but the operation waits until the current content is rendered and scheduled for delivery. Use it to show a placeholder first and replace it with content that is slow to render.
func (*Door) DeferredOuter ¶ added in v0.17.0
DeferredOuter is the same as Door.Outer, but the operation waits until the current content is rendered and scheduled for delivery. Use it to show a placeholder first and replace it with content that is slow to render.
func (*Door) DeferredStatic ¶ added in v0.17.0
DeferredStatic is the same as Door.Static, but the operation waits until the current content is rendered and scheduled for delivery. Use it to show a placeholder first and replace it with content that is slow to render.
func (*Door) Inner ¶ added in v0.10.0
Inner replaces the Door's children while keeping the same container mounted. A nil content empties it.
The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.
func (*Door) Outer ¶ added in v0.10.0
Outer replaces the Door container and its children with outer. A nil outer leaves an empty container. Unlike Door.Static, the result remains a live Door that can be updated further.
The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.
func (*Door) Proxy ¶
Proxy renders the Door in GoX with the following element as its container:
~>(new(doors.Door)) <div>content</div>
func (*Door) Reload ¶
Reload rerenders the Door with its current content.
The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.
func (*Door) Static ¶ added in v0.10.0
Static removes the Door container and renders content in its place. A nil content leaves nothing in place. Unlike Door.Outer, the result is no longer a live Door; later operations change the stored state without putting the Door back on the page.
The content belongs to the parent Door: hooks, subscriptions, calls, and lifecycle callbacks it registers attach to the parent, even if the render fails.
The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.
func (*Door) Unmount ¶
Unmount removes the Door from the page and keeps its current content for a future mount. Unlike Door.Static, the Door stays live and can be mounted again.
The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.