MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / getSdtId

Function getSdtId

packages/debugger/src/main/id.ts:41–50  ·  view source on GitHub ↗
(obj: ValueMap[T], objType: T)

Source from the content-addressed store, hash-verified

39export const getNewSdtId = (): NodeID => `#${(LastId++).toString(36)}`
40
41export function getSdtId<T extends ObjectType>(obj: ValueMap[T], objType: T): NodeID {
42 let id = WeakIdMap.get(obj)
43 if (!id) {
44 id = getNewSdtId()
45 WeakIdMap.set(obj, id)
46 RefMapMap[objType].set(id, new WeakRef(obj))
47 CleanupRegistry.register(obj, {map: objType, id})
48 }
49 return id
50}
51
52export const get_id_owner = (o: Solid.Owner): NodeID => getSdtId(o, ObjectType.Owner)
53export const get_id_el = (o: object): NodeID => getSdtId(o, ObjectType.Element)

Callers 15

store.tsFile · 0.90
trackStoreFunction · 0.90
untrackStoreFunction · 0.90
inspector.test.tsxFile · 0.90
encodeFunction · 0.90
map_source_valueFunction · 0.90
collect_owner_detailsFunction · 0.90
getNodePropFunction · 0.90
getTreeWalkerOwnerIdFunction · 0.90
createTopRootFunction · 0.90
cleanupRootFunction · 0.90
changeRootAttachmentFunction · 0.90

Calls 2

getNewSdtIdFunction · 0.85
getMethod · 0.80

Tested by 1

getNodePropFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…