Documentation
¶
Overview ¶
Package evmruntime supplies types shared by the Go host and guest code. Use Ambient to pass inherited values to nested GoX components.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var BindingSource embed.FS
Functions ¶
This section is empty.
Types ¶
type Ambient ¶
type Ambient struct {
// contains filtered or unexported fields
}
Ambient is an immutable stack of inherited values. Values themselves are not copied. A nil pointer is empty. CloneWith snapshots the supplied delta map.
func (*Ambient) CloneWith ¶
CloneWith overlays values on the receiver. It copies the map entries and shares the parent. An empty map returns the receiver.
Example ¶
package main
import (
"fmt"
"github.com/andreyvit/evm/evmruntime"
)
func main() {
var empty *evmruntime.Ambient
page := empty.CloneWith(map[string]any{"theme": "light", "lang": "en"})
panel := page.CloneWith(map[string]any{"theme": "dark"})
fmt.Println(page.Get("theme"), panel.Get("theme"), panel.Get("lang"))
}
Output: light dark en
Directories
¶
| Path | Synopsis |
|---|---|
|
Package concurrency provides state that parallel callbacks can safely share.
|
Package concurrency provides state that parallel callbacks can safely share. |
|
Package log sends guest output to the logging context supplied by the host.
|
Package log sends guest output to the logging context supplied by the host. |