MCPcopy Create free account
hub / github.com/TruthHun/BookStack / observe

Function observe

static/vuejs/vue.js:797–817  ·  view source on GitHub ↗

* Attempt to create an observer instance for a value, * returns the new observer if successfully observed, * or the existing observer if the value already has one.

(value, asRootData)

Source from the content-addressed store, hash-verified

795 * or the existing observer if the value already has one.
796 */
797function observe (value, asRootData) {
798 if (!isObject(value)) {
799 return
800 }
801 var ob;
802 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
803 ob = value.__ob__;
804 } else if (
805 observerState.shouldConvert &&
806 !isServerRendering() &&
807 (Array.isArray(value) || isPlainObject(value)) &&
808 Object.isExtensible(value) &&
809 !value._isVue
810 ) {
811 ob = new Observer(value);
812 }
813 if (asRootData && ob) {
814 ob.vmCount++;
815 }
816 return ob
817}
818
819/**
820 * Define a reactive property on an Object.

Callers 5

vue.jsFile · 0.70
defineReactive$$1Function · 0.70
validatePropFunction · 0.70
initStateFunction · 0.70
initDataFunction · 0.70

Calls 4

isObjectFunction · 0.70
hasOwnFunction · 0.70
isServerRenderingFunction · 0.70
isPlainObjectFunction · 0.70

Tested by

no test coverage detected