(vc *RenderContextImpl, initialVal any)
| 72 | } |
| 73 | |
| 74 | func UseLocal(vc *RenderContextImpl, initialVal any) string { |
| 75 | hookVal := vc.getOrderedHook() |
| 76 | atomName := "$local." + vc.GetCompWaveId() + "#" + strconv.Itoa(hookVal.Idx) |
| 77 | if !hookVal.Init { |
| 78 | hookVal.Init = true |
| 79 | atom := MakeAtomImpl(initialVal, nil) |
| 80 | vc.Root.RegisterAtom(atomName, atom) |
| 81 | closedAtomName := atomName |
| 82 | hookVal.UnmountFn = func() { |
| 83 | vc.Root.RemoveAtom(closedAtomName) |
| 84 | } |
| 85 | } |
| 86 | return atomName |
| 87 | } |
| 88 | |
| 89 | func UseVDomRef(vc *RenderContextImpl) any { |
| 90 | hookVal := vc.getOrderedHook() |
no test coverage detected