door

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyPayload added in v0.10.0

func EmptyPayload() printer.Payload

Types

type Done

type Done = bool

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

func (d *Door) DeferredInner(ctx context.Context, content any) <-chan error

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

func (d *Door) DeferredOuter(ctx context.Context, outer any) <-chan error

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

func (d *Door) DeferredStatic(ctx context.Context, content any) <-chan error

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

func (d *Door) Inner(ctx context.Context, content any) <-chan error

Inner replaces the Door's children while keeping the same container mounted. A nil content empties it.

The returned channel is optional to use. It sends nil once the operation is scheduled, or an error if it fails before that; context.Canceled means a newer operation superseded this one. On a detached context (doors.DetachedContext, doors.Go) a second value reports the result: nil once applied to the page, or an error; otherwise the channel closes once the operation is scheduled. If you need the result, wait for the second value; it only arrives on a detached context. If the Door is not mounted, it closes without a value. Never wait on the channel during rendering or in a subscription.

func (*Door) Main

func (d *Door) Main() gox.Elem

Main renders the Door directly in GoX:

~(&doors.Door{})

func (*Door) Outer added in v0.10.0

func (d *Door) Outer(ctx context.Context, outer any) <-chan error

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. It sends nil once the operation is scheduled, or an error if it fails before that; context.Canceled means a newer operation superseded this one. On a detached context (doors.DetachedContext, doors.Go) a second value reports the result: nil once applied to the page, or an error; otherwise the channel closes once the operation is scheduled. If you need the result, wait for the second value; it only arrives on a detached context. If the Door is not mounted, it closes without a value. Never wait on the channel during rendering or in a subscription.

func (*Door) Proxy

func (d *Door) Proxy(cur gox.Cursor, el gox.Elem) error

Proxy renders the Door in GoX with the following element as its container:

~>(new(doors.Door)) <div>content</div>

func (*Door) Reload

func (d *Door) Reload(ctx context.Context) <-chan error

Reload rerenders the Door with its current content.

The returned channel is optional to use. It sends nil once the operation is scheduled, or an error if it fails before that; context.Canceled means a newer operation superseded this one. On a detached context (doors.DetachedContext, doors.Go) a second value reports the result: nil once applied to the page, or an error; otherwise the channel closes once the operation is scheduled. If you need the result, wait for the second value; it only arrives on a detached context. If the Door is not mounted, it closes without a value. Never wait on the channel during rendering or in a subscription.

func (*Door) Static added in v0.10.0

func (d *Door) Static(ctx context.Context, content any) <-chan error

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. It sends nil once the operation is scheduled, or an error if it fails before that; context.Canceled means a newer operation superseded this one. On a detached context (doors.DetachedContext, doors.Go) a second value reports the result: nil once applied to the page, or an error; otherwise the channel closes once the operation is scheduled. If you need the result, wait for the second value; it only arrives on a detached context. If the Door is not mounted, it closes without a value. Never wait on the channel during rendering or in a subscription.

func (*Door) Unmount

func (d *Door) Unmount(ctx context.Context) <-chan error

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. It sends nil once the operation is scheduled, or an error if it fails before that; context.Canceled means a newer operation superseded this one. On a detached context (doors.DetachedContext, doors.Go) a second value reports the result: nil once applied to the page, or an error; otherwise the channel closes once the operation is scheduled. If you need the result, wait for the second value; it only arrives on a detached context. If the Door is not mounted, it closes without a value. Never wait on the channel during rendering or in a subscription.

type Instance

type Instance interface {
	Call(call actions.Call, group uint64, batch uint64, door uint64, depSeq uint64, depDoor uint64) uint64
	core.Instance
}

type Pipe added in v0.10.0

type Pipe = *pipe

type Root

type Root = *root

func NewRoot

func NewRoot(inst Instance) Root

func (Root) ID

func (r Root) ID() uint64

func (Root) Kill

func (r Root) Kill()

func (Root) Render

func (r Root) Render(requestCtx context.Context, comp gox.Comp) (Stack, error)

type Stack

type Stack []*deque.Deque[any]

func (*Stack) Print added in v0.10.0

func (p *Stack) Print(pr gox.Printer) error

func (*Stack) Release added in v0.13.19

func (p *Stack) Release()

Jump to

Keyboard shortcuts

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