MCPcopy
hub / github.com/keepfool/vue-tutorials / Observer

Function Observer

06.Router/basic/js/vue.js:2108–2119  ·  view source on GitHub ↗

* Observer class that are attached to each observed * object. Once attached, the observer converts target * object's property keys into getter/setters that * collect dependencies and dispatches updates. * * @param {Array|Object} value * @constructor

(value)

Source from the content-addressed store, hash-verified

2106 */
2107
2108 function Observer(value) {
2109 this.value = value;
2110 this.dep = new Dep();
2111 def(value, '__ob__', this);
2112 if (isArray(value)) {
2113 var augment = hasProto ? protoAugment : copyAugment;
2114 augment(value, arrayMethods, arrayKeys);
2115 this.observeArray(value);
2116 } else {
2117 this.walk(value);
2118 }
2119 }
2120
2121 // Instance methods
2122

Callers

nothing calls this directly

Calls 2

isArrayFunction · 0.85
defFunction · 0.70

Tested by

no test coverage detected