devhook

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package devhook connects the development tools to the packages they watch, without those packages importing the tools. Each hook is nil until package devtools sets it (see devtools/hot), so a program that does not link the tools only checks a nil function.

Index

Constants

This section is empty.

Variables

View Source
var (
	ViewCapture func(runtime any) []byte
	ViewRestore func(runtime any, state []byte)
)

ViewCapture returns a runtime's view state (focus, scroll, carets) as JSON, and ViewRestore gives it back to a new runtime, applied after its first layout. Package ui sets them.

View Source
var Checkpoint func(path string) (int, error)

Checkpoint writes the state that survives a restart under `jamb dev` to the file at path, and returns how many values it wrote (see devtools/hot).

View Source
var Local func(path, name string, signal any, current func() any)

Local is called when ui.Local creates a component's local signal: path names the component by its place in the tree (see ui's sitePath), name is the local's name and signal the *ui.Signal[T]. The hook may set the signal's value before the component reads it. current returns the signal while its component is alive, and nil once it is gone; call it on the UI thread. It holds neither the component nor the signal.

View Source
var Runtime func(current func() any)

Runtime is called when a ui.Runtime is made, with a function that returns it while it is alive and nil after. Windows make theirs in the order they open, which numbers them.

View Source
var Started func()

Started is called by the app when its startup code has run: in app.Run, before the first window's first frame. Values kept across a restart for the signals made until then are applied then, after the startup code's own.

View Source
var TagComponent func(component any, site string)

TagComponent names a *ui.ComponentElement by its call in the app's source, for jamb dev's rewrite. Package ui sets it.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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