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

Function observe

static/vuejs/vue.runtime.common.js:789–809  ·  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

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

Callers 5

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