runtime

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassIdProps

func ClassIdProps(class, id string) map[string]interface{}

func ClassProps

func ClassProps(class string) map[string]interface{}

func EmptyProps

func EmptyProps() map[string]interface{}

func EnqueueUI

func EnqueueUI(fn func())

EnqueueUI adds a function to the UI queue for main thread execution

func GetUIQueueSize

func GetUIQueueSize() int

GetUIQueueSize returns the current UI queue size

func GoUseAtom

func GoUseAtom[T any](rt *Runtime, id string, initialValue T) (func() T, func(interface{}))

GoUseAtom provides access to global state with fine-grained reactivity. Unlike useState which is local to a component, atoms are shared across components. When an atom updates, only components that use that specific atom re-render.

func GoUseAtomGlobal

func GoUseAtomGlobal[T any](id string, initialValue T) (func() T, func(T))

GoUseAtomGlobal wraps GoUseAtom with global runtime

func GoUseCallback

func GoUseCallback(fn interface{}, deps ...interface{}) interface{}

GoUseCallback memoizes a callback function with dependency tracking

func GoUseCallbackGlobal

func GoUseCallbackGlobal(fn interface{}, deps ...interface{}) interface{}

GoUseCallbackGlobal wraps GoUseCallback

func GoUseEffect

func GoUseEffect(effect func() func(), deps ...interface{})

GoUseEffect runs side effects and supports cleanup The effect function can return a cleanup function that will be called before the next effect runs or on unmount

func GoUseEffectGlobal

func GoUseEffectGlobal(effect func() func(), deps ...interface{})

GoUseEffectGlobal wraps GoUseEffect

func GoUseFetch

func GoUseFetch(url string, options ...interface{}) (func() FetchState, func())

GoUseFetch is a manual-trigger fetch hook that manages async data fetching It uses goroutines and channels internally to fetch data without blocking Unlike GoUseEffect-based auto-fetching, this requires explicit refetch() calls

Returns:

  • A getter function for the current FetchState (data, error, loading)
  • A refetch function to manually trigger the fetch

The FetchState contains:

  • Data: the fetched response body (as string)
  • Error: error message if fetch failed (empty string if successful)
  • Loading: whether currently fetching

func GoUseFetchGlobal

func GoUseFetchGlobal(url string, options ...interface{}) (func() FetchState, func())

GoUseFetchGlobal wraps GoUseFetch with global fiber context

func GoUseFunc

func GoUseFunc(fn interface{}) interface{}

GoUseFunc validates and stores a function for event handling The actual wrapping to js.Value happens in the WASM shim layer

func GoUseFuncGlobal

func GoUseFuncGlobal(fn interface{}) interface{}

GoUseFuncGlobal wraps GoUseFunc with WASM event handler wrapping

func GoUseId

func GoUseId() string

GoUseId generates a unique, stable identifier for accessibility attributes The ID is generated once and persists across renders without changing This is useful for associating labels with form inputs and other accessibility needs

func GoUseIdGlobal

func GoUseIdGlobal() string

GoUseIdGlobal wraps GoUseId

func GoUseMemo

func GoUseMemo(compute func() interface{}, deps ...interface{}) interface{}

GoUseMemo memoizes expensive computations

func GoUseMemoGlobal

func GoUseMemoGlobal(compute func() interface{}, deps ...interface{}) interface{}

GoUseMemoGlobal wraps GoUseMemo

func GoUseState

func GoUseState[T any](rt *Runtime, initialValue T) (func() T, func(interface{}))

GoUseState provides state management for components

func GoUseStateGlobal

func GoUseStateGlobal[T any](initialValue T) (func() T, func(interface{}))

GoUseStateGlobal wraps GoUseState with global fiber context

func HrefProps

func HrefProps(href string) map[string]interface{}

func IdProps

func IdProps(id string) map[string]interface{}

func InitGlobalRuntime

func InitGlobalRuntime(config Config)

InitGlobalRuntime initializes the global runtime with specific adapters This should be called early in WASM initialization

func InputTypeProps

func InputTypeProps(typ string) map[string]interface{}

func PlaceholderProps

func PlaceholderProps(placeholder string) map[string]interface{}

func ProcessUIQueue

func ProcessUIQueue()

ProcessUIQueue processes pending UI updates

func SetCurrentFiber

func SetCurrentFiber(fiber *Fiber)

SetCurrentFiber sets the current fiber (used during component rendering)

func SrcProps

func SrcProps(src string) map[string]interface{}

func StyleProps

func StyleProps(style string) map[string]interface{}

func TypeProps

func TypeProps(typ string) map[string]interface{}

func ValueProps

func ValueProps(value interface{}) map[string]interface{}

Types

type AtomRegistry

type AtomRegistry struct {
	// contains filtered or unexported fields
}

AtomRegistry manages global state atoms with fine-grained reactivity. Each atom has a unique ID and tracks which fibers are subscribed to it.

func NewAtomRegistry

func NewAtomRegistry() *AtomRegistry

NewAtomRegistry creates a new atom registry

func (*AtomRegistry) GetAtom

func (ar *AtomRegistry) GetAtom(id string) (interface{}, bool)

GetAtom retrieves an atom's current value

func (*AtomRegistry) GetAtomCount

func (ar *AtomRegistry) GetAtomCount() int

GetAtomCount returns the total number of atoms

func (*AtomRegistry) GetSubscriberCount

func (ar *AtomRegistry) GetSubscriberCount(atomID string) int

GetSubscriberCount returns the number of fibers subscribed to an atom

func (*AtomRegistry) InitAtom

func (ar *AtomRegistry) InitAtom(id string, initialValue interface{})

InitAtom initializes an atom if it doesn't exist

func (*AtomRegistry) SetAtom

func (ar *AtomRegistry) SetAtom(id string, value interface{}) []*Fiber

SetAtom updates an atom's value and returns subscribed fibers

func (*AtomRegistry) Subscribe

func (ar *AtomRegistry) Subscribe(atomID string, fiber *Fiber)

Subscribe adds a fiber to an atom's subscription list

func (*AtomRegistry) Unsubscribe

func (ar *AtomRegistry) Unsubscribe(atomID string, fiber *Fiber)

Unsubscribe removes a fiber from an atom's subscription list

func (*AtomRegistry) UnsubscribeFiberFromAll

func (ar *AtomRegistry) UnsubscribeFiberFromAll(fiber *Fiber)

UnsubscribeFiberFromAll removes a fiber from all atom subscriptions

func (*AtomRegistry) UnsubscribeMany

func (ar *AtomRegistry) UnsubscribeMany(atomIDs []string, fiber *Fiber)

UnsubscribeMany removes a fiber from several atom subscriptions under one lock.

type Attrs

type Attrs map[string]interface{}

Attrs is a convenience type for component props

type BrowserState

type BrowserState interface {
	// History
	PushState(state interface{}, title, url string)
	ReplaceState(state interface{}, title, url string)
	GetCurrentPath() string
	OnPopState(callback func(path string))

	// Storage
	SetItem(key, value string) error
	GetItem(key string) (string, bool)
	RemoveItem(key string)

	// Location
	GetHash() string
	SetHash(hash string)
	Reload()
}

BrowserState abstracts browser state APIs

type Config

type Config struct {
	DOMAdapter   DOMAdapter
	EventAdapter EventAdapter
	Scheduler    Scheduler
	BrowserState BrowserState
}

Config holds runtime configuration

type DOMAdapter

type DOMAdapter interface {
	// Element creation and manipulation
	CreateElement(tag string) DOMNode
	CreateTextNode(text string) DOMNode
	SetAttribute(node DOMNode, name, value string)
	RemoveAttribute(node DOMNode, name string)
	SetProperty(node DOMNode, name string, value interface{})
	GetProperty(node DOMNode, name string) interface{}

	// Tree manipulation
	AppendChild(parent, child DOMNode)
	RemoveChild(parent, child DOMNode)
	InsertBefore(parent, newNode, referenceNode DOMNode)
	ReplaceChild(parent, newNode, oldNode DOMNode)

	// Queries
	GetParent(node DOMNode) DOMNode
	GetChildren(node DOMNode) []DOMNode
	GetFirstChild(node DOMNode) DOMNode
	GetNextSibling(node DOMNode) DOMNode

	// Text nodes
	SetTextContent(node DOMNode, text string)

	// Styling
	SetStyle(node DOMNode, property, value string)
	SetStyles(node DOMNode, styles map[string]string)
	SetInnerHTML(node DOMNode, html string)

	// Function wrapping
	WrapFunction(fn interface{}) interface{}
}

DOMAdapter abstracts all DOM operations

type DOMNode

type DOMNode interface {
	IsNull() bool
	// TODO: clarify how nil vs IsNull interact for adapters to avoid mixed nil/IsNull checks
	Equals(other DOMNode) bool
}

DOMNode is an opaque reference to a platform-specific DOM node

type Deadline

type Deadline interface {
	TimeRemaining() float64
	DidTimeout() bool
}

Deadline provides timing information for idle callbacks

type Effect

type Effect struct {
	Fn           func() func()
	CleanupIndex int
}

Effect represents a side effect to be run after render

type Element

type Element struct {
	Type        interface{}
	Props       map[string]interface{}
	Children    []interface{}
	TextContent string // Optimization for TEXT_ELEMENT to avoid map allocation
}

Element represents a virtual DOM node

func A

func A(props map[string]interface{}, children ...interface{}) *Element

func Abbr

func Abbr(props map[string]interface{}, children ...interface{}) *Element

func Address

func Address(props map[string]interface{}, children ...interface{}) *Element

func Article

func Article(props map[string]interface{}, children ...interface{}) *Element

func Aside

func Aside(props map[string]interface{}, children ...interface{}) *Element

func Audio

func Audio(props map[string]interface{}, children ...interface{}) *Element

func B

func B(props map[string]interface{}, children ...interface{}) *Element

func Bdi

func Bdi(props map[string]interface{}, children ...interface{}) *Element

func Bdo

func Bdo(props map[string]interface{}, children ...interface{}) *Element

func Blockquote

func Blockquote(props map[string]interface{}, children ...interface{}) *Element

func Body

func Body(props map[string]interface{}, children ...interface{}) *Element

func Br

func Br(props map[string]interface{}) *Element

func Button

func Button(props map[string]interface{}, children ...interface{}) *Element

func Canvas

func Canvas(props map[string]interface{}, children ...interface{}) *Element

func Caption

func Caption(props map[string]interface{}, children ...interface{}) *Element

func Circle

func Circle(props map[string]interface{}) *Element

func Cite

func Cite(props map[string]interface{}, children ...interface{}) *Element

func Code

func Code(props map[string]interface{}, children ...interface{}) *Element

func Col

func Col(props map[string]interface{}) *Element

func Colgroup

func Colgroup(props map[string]interface{}, children ...interface{}) *Element

func CreateElement

func CreateElement(typ interface{}, props map[string]interface{}, children ...interface{}) *Element

CreateElement creates a new virtual DOM element

func Data

func Data(props map[string]interface{}, children ...interface{}) *Element

func Datalist

func Datalist(props map[string]interface{}, children ...interface{}) *Element

func Dd

func Dd(props map[string]interface{}, children ...interface{}) *Element

func Del

func Del(props map[string]interface{}, children ...interface{}) *Element

func Details

func Details(props map[string]interface{}, children ...interface{}) *Element

func Dfn

func Dfn(props map[string]interface{}, children ...interface{}) *Element

func Dialog

func Dialog(props map[string]interface{}, children ...interface{}) *Element

func Div

func Div(props map[string]interface{}, children ...interface{}) *Element

func DivWithComponents

func DivWithComponents(props map[string]interface{}, componentRefs ...func(map[string]interface{}) *Element) *Element

func Dl

func Dl(props map[string]interface{}, children ...interface{}) *Element

func Dt

func Dt(props map[string]interface{}, children ...interface{}) *Element

func Em

func Em(props map[string]interface{}, children ...interface{}) *Element

func Embed

func Embed(props map[string]interface{}) *Element

func Fieldset

func Fieldset(props map[string]interface{}, children ...interface{}) *Element

func Figcaption

func Figcaption(props map[string]interface{}, children ...interface{}) *Element

func Figure

func Figure(props map[string]interface{}, children ...interface{}) *Element
func Footer(props map[string]interface{}, children ...interface{}) *Element

func Form

func Form(props map[string]interface{}, children ...interface{}) *Element

func G

func G(props map[string]interface{}, children ...interface{}) *Element

func H1

func H1(props map[string]interface{}, children ...interface{}) *Element

func H2

func H2(props map[string]interface{}, children ...interface{}) *Element

func H3

func H3(props map[string]interface{}, children ...interface{}) *Element

func H4

func H4(props map[string]interface{}, children ...interface{}) *Element

func H5

func H5(props map[string]interface{}, children ...interface{}) *Element

func H6

func H6(props map[string]interface{}, children ...interface{}) *Element
func Head(props map[string]interface{}, children ...interface{}) *Element
func Header(props map[string]interface{}, children ...interface{}) *Element

func Hgroup

func Hgroup(props map[string]interface{}, children ...interface{}) *Element

func Hr

func Hr(props map[string]interface{}) *Element

func Html

func Html(props map[string]interface{}, children ...interface{}) *Element

func I

func I(props map[string]interface{}, children ...interface{}) *Element

func Iframe

func Iframe(props map[string]interface{}, children ...interface{}) *Element

func Img

func Img(props map[string]interface{}) *Element

func Input

func Input(props map[string]interface{}) *Element

func Ins

func Ins(props map[string]interface{}, children ...interface{}) *Element

func Kbd

func Kbd(props map[string]interface{}, children ...interface{}) *Element

func Label

func Label(props map[string]interface{}, children ...interface{}) *Element

func Legend

func Legend(props map[string]interface{}, children ...interface{}) *Element

func Li

func Li(props map[string]interface{}, children ...interface{}) *Element

func Line

func Line(props map[string]interface{}) *Element
func Link(props map[string]interface{}) *Element

func Main

func Main(props map[string]interface{}, children ...interface{}) *Element

func MainWithComponents

func MainWithComponents(props map[string]interface{}, componentRefs ...func(map[string]interface{}) *Element) *Element

func Mark

func Mark(props map[string]interface{}, children ...interface{}) *Element
func Menu(props map[string]interface{}, children ...interface{}) *Element

func Meta

func Meta(props map[string]interface{}) *Element

func Meter

func Meter(props map[string]interface{}, children ...interface{}) *Element
func Nav(props map[string]interface{}, children ...interface{}) *Element

func Object

func Object(props map[string]interface{}, children ...interface{}) *Element

func Ol

func Ol(props map[string]interface{}, children ...interface{}) *Element

func Optgroup

func Optgroup(props map[string]interface{}, children ...interface{}) *Element

func Option

func Option(props map[string]interface{}, children ...interface{}) *Element

func Output

func Output(props map[string]interface{}, children ...interface{}) *Element

func P

func P(props map[string]interface{}, children ...interface{}) *Element

func Param

func Param(props map[string]interface{}) *Element

func Path

func Path(props map[string]interface{}) *Element

func Picture

func Picture(props map[string]interface{}, children ...interface{}) *Element

func Polygon

func Polygon(props map[string]interface{}) *Element

func Portal

func Portal(props map[string]interface{}, children ...interface{}) *Element

func Pre

func Pre(props map[string]interface{}, children ...interface{}) *Element

func Progress

func Progress(props map[string]interface{}, children ...interface{}) *Element

func Q

func Q(props map[string]interface{}, children ...interface{}) *Element

func Rect

func Rect(props map[string]interface{}) *Element

func Rp

func Rp(props map[string]interface{}, children ...interface{}) *Element

func Rt

func Rt(props map[string]interface{}, children ...interface{}) *Element

func Ruby

func Ruby(props map[string]interface{}, children ...interface{}) *Element

func S

func S(props map[string]interface{}, children ...interface{}) *Element

func Samp

func Samp(props map[string]interface{}, children ...interface{}) *Element

func Script

func Script(props map[string]interface{}, children ...interface{}) *Element

func Section

func Section(props map[string]interface{}, children ...interface{}) *Element

func SectionWithComponents

func SectionWithComponents(props map[string]interface{}, componentRefs ...func(map[string]interface{}) *Element) *Element

func Select

func Select(props map[string]interface{}, children ...interface{}) *Element

func Slot

func Slot(props map[string]interface{}, children ...interface{}) *Element

func Small

func Small(props map[string]interface{}, children ...interface{}) *Element

func Source

func Source(props map[string]interface{}) *Element

func Span

func Span(props map[string]interface{}, children ...interface{}) *Element

func Strong

func Strong(props map[string]interface{}, children ...interface{}) *Element

func Style

func Style(props map[string]interface{}, children ...interface{}) *Element

func Sub

func Sub(props map[string]interface{}, children ...interface{}) *Element

func Summary

func Summary(props map[string]interface{}, children ...interface{}) *Element

func Sup

func Sup(props map[string]interface{}, children ...interface{}) *Element

func Svg

func Svg(props map[string]interface{}, children ...interface{}) *Element

func Table

func Table(props map[string]interface{}, children ...interface{}) *Element

func Tbody

func Tbody(props map[string]interface{}, children ...interface{}) *Element

func Td

func Td(props map[string]interface{}, children ...interface{}) *Element

func Template

func Template(props map[string]interface{}, children ...interface{}) *Element

func Text

func Text(content string) *Element

Text creates a text node

func Textarea

func Textarea(props map[string]interface{}, children ...interface{}) *Element

func Tfoot

func Tfoot(props map[string]interface{}, children ...interface{}) *Element

func Th

func Th(props map[string]interface{}, children ...interface{}) *Element

func Thead

func Thead(props map[string]interface{}, children ...interface{}) *Element

func Time

func Time(props map[string]interface{}, children ...interface{}) *Element

func Title

func Title(props map[string]interface{}, children ...interface{}) *Element

func Tr

func Tr(props map[string]interface{}, children ...interface{}) *Element

func Track

func Track(props map[string]interface{}) *Element

func U

func U(props map[string]interface{}, children ...interface{}) *Element

func Ul

func Ul(props map[string]interface{}, children ...interface{}) *Element

func Var

func Var(props map[string]interface{}, children ...interface{}) *Element

func Video

func Video(props map[string]interface{}, children ...interface{}) *Element

func Wbr

func Wbr(props map[string]interface{}) *Element

func WithComponents

func WithComponents(tagName string, props map[string]interface{}, componentRefs ...func(map[string]interface{}) *Element) *Element

type Event

type Event interface {
	PreventDefault()
	StopPropagation()
	GetValue() string
	GetTarget() DOMNode
	GetKeyCode() int
	GetKey() string
	IsChecked() bool
}

Event abstracts platform-specific events

type EventAdapter

type EventAdapter interface {
	AddEventListener(node DOMNode, eventType string, handler EventHandler)
	RemoveEventListener(node DOMNode, eventType string, handler EventHandler)
	CreateEventHandler(fn func(Event)) EventHandler
	ReleaseEventHandler(handler EventHandler)
}

EventAdapter abstracts event handling

type EventHandler

type EventHandler interface {
	Release()
}

EventHandler is an opaque reference to a platform-specific event handler

type FetchState

type FetchState struct {
	Data    interface{} // The fetched data
	Error   string      // Error message if fetch failed
	Loading bool        // Whether currently fetching
}

FetchState represents the state of a fetch operation

type Fiber

type Fiber struct {
	// contains filtered or unexported fields
}

Fiber represents a unit of work in the virtual DOM tree

func GetCurrentFiber

func GetCurrentFiber() *Fiber

GetCurrentFiber returns the fiber currently being processed

type GoEvent

type GoEvent struct {
	// contains filtered or unexported fields
}

GoEvent is a Go-friendly wrapper around the JavaScript event object. It provides a safe, convenient API for working with DOM events in Go.

GoEvent is automatically provided to event handlers registered with GoUseFunc when using the func(GoEvent) signature.

Example:

handleClick := hooks.GoUseFunc(func(event dom.GoEvent) {
    event.PreventDefault()
    println("Clicked!")
})

Button(Attrs{"onclick": handleClick}, "Click Me")

Example with form input:

handleChange := hooks.GoUseFunc(func(event dom.GoEvent) {
    value := event.GetValue()
    println("New value:", value)
})

Input(Attrs{"oninput": handleChange}, nil)

func NewGoEvent

func NewGoEvent(jsEvent js.Value) GoEvent

NewGoEvent creates a GoEvent wrapper around a JavaScript event object. This is typically called internally by the hooks system.

func (GoEvent) GetKey

func (e GoEvent) GetKey() string

GetKey retrieves the key name from keyboard events (onkeydown, onkeyup, onkeypress). This allows you to detect which key was pressed.

Example:

handleKeyDown := hooks.GoUseFunc(func(event dom.GoEvent) {
    if event.GetKey() == "Enter" {
        handleSubmit()
    }
})

Common key values:

  • "Enter", "Escape", "Tab", "Backspace", "Delete"
  • "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"
  • " " for Space
  • Alphanumeric characters for letter/number keys

Returns empty string if this is not a keyboard event or key is not available.

func (GoEvent) GetKeyCode

func (e GoEvent) GetKeyCode() int

GetKeyCode retrieves the legacy numeric keyCode for keyboard events. It returns 0 when the keyCode is unavailable.

func (GoEvent) GetTarget

func (e GoEvent) GetTarget() DOMNode

GetTarget retrieves the event target as a DOMNode. It returns nil when the event has no target.

func (GoEvent) GetValue

func (e GoEvent) GetValue() string

GetValue retrieves the value of an input element from the event target. This is commonly used with oninput, onchange, and other input events.

Example:

handleInput := hooks.GoUseFunc(func(event dom.GoEvent) {
    inputValue := event.GetValue()
    setSearchTerm(inputValue)
})

Returns empty string if the target has no value property.

func (GoEvent) IsChecked

func (e GoEvent) IsChecked() bool

IsChecked retrieves the checked state of a checkbox or radio button from the event target. This is commonly used with onchange events on checkboxes and radio buttons.

Example:

handleToggle := hooks.GoUseFunc(func(event dom.GoEvent) {
    isChecked := event.IsChecked()
    setEnabled(isChecked)
})

Returns false if the target has no checked property.

func (GoEvent) JSValue

func (e GoEvent) JSValue() js.Value

JSValue returns the underlying JavaScript event object. This provides access to any properties or methods not covered by the GoEvent API.

Example accessing custom properties:

handleCustomEvent := hooks.GoUseFunc(func(event dom.GoEvent) {
    customData := event.JSValue().Get("customProperty").String()
})

func (GoEvent) PreventDefault

func (e GoEvent) PreventDefault()

PreventDefault prevents the browser's default action for the event. This is useful for form submissions, link navigation, and other browser defaults.

Example preventing form submission:

handleSubmit := hooks.GoUseFunc(func(event dom.GoEvent) {
    event.PreventDefault()
    // Handle form submission in Go
    submitForm()
})

Example preventing link navigation:

handleLinkClick := hooks.GoUseFunc(func(event dom.GoEvent) {
    event.PreventDefault()
    // Navigate using router instead
    router.Navigate("/page")
})

func (GoEvent) StopPropagation

func (e GoEvent) StopPropagation()

StopPropagation prevents the event from bubbling up to parent elements. This is useful when you want to handle an event without it affecting parent elements.

Example preventing click bubbling:

handleModalClick := hooks.GoUseFunc(func(event dom.GoEvent) {
    event.StopPropagation()
    // Handle modal click without closing
})

Example in a nested list:

handleItemClick := hooks.GoUseFunc(func(event dom.GoEvent) {
    event.StopPropagation()
    selectItem()
})

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

Hooks manages component hook state

type RefValue

type RefValue struct {
	Current interface{}
}

RefValue represents a reference object that persists across renders It has a single .current property that can hold any value

func GoUseRef

func GoUseRef(initialValue interface{}) *RefValue

GoUseRef creates a mutable reference that persists across renders It returns a RefValue object with a .Current field that can hold any value Unlike state, updating a ref does NOT trigger a re-render

func GoUseRefGlobal

func GoUseRefGlobal(initialValue interface{}) *RefValue

GoUseRefGlobal wraps GoUseRef

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime represents the reconciliation and rendering engine

func GetGlobalRuntime

func GetGlobalRuntime() *Runtime

GetGlobalRuntime returns the global Runtime instance, creating it if needed For WASM builds, this automatically uses WASM platform adapters

func NewRuntime

func NewRuntime(config Config) *Runtime

NewRuntime creates a new runtime instance

func (*Runtime) CleanupAtomSubscriptions

func (rt *Runtime) CleanupAtomSubscriptions(fiber *Fiber)

CleanupAtomSubscriptions removes all atom subscriptions for a fiber This should be called when a fiber is being removed from the tree

func (*Runtime) GetAtomValue

func (rt *Runtime) GetAtomValue(id string) (interface{}, bool)

GetAtomValue is a helper to get an atom value directly (for debugging/testing)

func (*Runtime) Render

func (rt *Runtime) Render(element *Element, container DOMNode)

Render starts rendering a component tree

func (*Runtime) RenderTo

func (rt *Runtime) RenderTo(selector string, element *Element)

RenderTo renders an element to a DOM node specified by selector

func (*Runtime) ScheduleUpdate

func (rt *Runtime) ScheduleUpdate()

ScheduleUpdate schedules a full tree update from the root

func (*Runtime) ScheduleUpdateForFiber

func (rt *Runtime) ScheduleUpdateForFiber(fiber *Fiber)

ScheduleUpdateForFiber schedules an update for a specific fiber

func (*Runtime) SetAtomValue

func (rt *Runtime) SetAtomValue(id string, value interface{}) error

SetAtomValue is a helper to set an atom value directly (for debugging/testing)

type Scheduler

type Scheduler interface {
	RequestIdleCallback(callback func(deadline Deadline))
	SetTimeout(callback func(), delay int)
}

Scheduler abstracts work scheduling

Jump to

Keyboard shortcuts

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