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

Function observe

static/vuejs/vue.runtime.js:793–813  ·  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

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

Callers 5

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