MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / DataAtom

Function DataAtom

tsunami/app/defaultclient.go:83–90  ·  view source on GitHub ↗
(name string, defaultValue T, meta *AtomMeta)

Source from the content-addressed store, hash-verified

81}
82
83func DataAtom[T any](name string, defaultValue T, meta *AtomMeta) Atom[T] {
84 fullName := "$data." + name
85 client := engine.GetDefaultClient()
86 engineMeta := convertAppMetaToEngineMeta(meta)
87 atom := engine.MakeAtomImpl(defaultValue, engineMeta)
88 client.Root.RegisterAtom(fullName, atom)
89 return Atom[T]{name: fullName, client: client}
90}
91
92func SharedAtom[T any](name string, defaultValue T) Atom[T] {
93 fullName := "$shared." + name

Callers 5

app.goFile · 0.92
app.goFile · 0.92
app.goFile · 0.92
app.goFile · 0.92
app.goFile · 0.92

Calls 4

GetDefaultClientFunction · 0.92
MakeAtomImplFunction · 0.92
RegisterAtomMethod · 0.80

Tested by

no test coverage detected