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

Function observe

static/vuejs/vue.esm.js:791–811  ·  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

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

Callers 5

vue.esm.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