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

Method getOrderedHook

tsunami/engine/hooks.go:47–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47func (vc *RenderContextImpl) getOrderedHook() *Hook {
48 if vc.Comp == nil {
49 panic("tsunami hooks must be called within a component (vc.Comp is nil)")
50 }
51 for len(vc.Comp.Hooks) <= vc.HookIdx {
52 vc.Comp.Hooks = append(vc.Comp.Hooks, &Hook{Idx: len(vc.Comp.Hooks)})
53 }
54 hookVal := vc.Comp.Hooks[vc.HookIdx]
55 vc.HookIdx++
56 return hookVal
57}
58
59func (vc *RenderContextImpl) getCompName() string {
60 if vc.Comp == nil || vc.Comp.Elem == nil {

Callers 4

UseLocalFunction · 0.80
UseVDomRefFunction · 0.80
UseRefFunction · 0.80
UseEffectFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected