MCPcopy
hub / github.com/mobxjs/mobx / getDebugName

Function getDebugName

packages/mobx/src/types/type-utils.ts:87–100  ·  view source on GitHub ↗
(thing: any, property?: string)

Source from the content-addressed store, hash-verified

85}
86
87export function getDebugName(thing: any, property?: string): string {
88 let named
89 if (property !== undefined) {
90 named = getAtom(thing, property)
91 } else if (isAction(thing)) {
92 return thing.name
93 } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {
94 named = getAdministration(thing)
95 } else {
96 // valid for arrays as well
97 named = getAtom(thing)
98 }
99 return named.name_
100}
101
102/**
103 * Helper function for initializing observable structures, it applies:

Callers 3

make-observable.tsFile · 0.90
asObservableObjectFunction · 0.85
getAtomFunction · 0.85

Calls 4

getAtomFunction · 0.85
isObservableMapFunction · 0.85
isObservableObjectFunction · 0.70
getAdministrationFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…