Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(reactive) {
super();
if (reactive) {
let _this = observe(this, { deep: true, batch: true });
Object.defineProperty(this, "rule", { value: fn => computed(fn) });
return _this;
}
}
}
constructor(scope, defaultResolver) {
Object.defineProperty(this, "resolver", { value: new Resolver(defaultResolver) });
scope.$ = observe({ }, { deep: true, batch: true });
scope.observe = observe;
scope.rule = computed;
scope.context = this;
Object.defineProperty(this, "scope", {
value: new Proxy(scope, {
get: (scope, name) => (name in scope) ? scope[name] : scope.$[name],
set: (scope, name, value) => {
if (!(name in scope) && scope.$[name]) scope.$[name] = value;
else scope[name] = value;
return true;
}
})
});
Object.defineProperty(this, "vm", {