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

Function collectStoredAnnotations

packages/mobx/src/api/decorators.ts:70–81  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

68 * Collects annotations from prototypes and stores them on target (instance)
69 */
70export function collectStoredAnnotations(target): AnnotationsMap<any, any> {
71 if (!hasProp(target, storedAnnotationsSymbol)) {
72 // if (__DEV__ && !target[storedAnnotationsSymbol]) {
73 // die(
74 // `No annotations were passed to makeObservable, but no decorated members have been found either`
75 // )
76 // }
77 // We need a copy as we will remove annotation from the list once it's applied.
78 addHiddenProp(target, storedAnnotationsSymbol, { ...target[storedAnnotationsSymbol] })
79 }
80 return target[storedAnnotationsSymbol]
81}
82
83export function is20223Decorator(context): context is DecoratorContext {
84 return typeof context == "object" && typeof context["kind"] == "string"

Callers 1

makeObservableFunction · 0.85

Calls 2

hasPropFunction · 0.85
addHiddenPropFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…