This commit is contained in:
2024-07-31 23:30:21 -04:00
parent 0a857f8de4
commit e38504457c
5 changed files with 91 additions and 46 deletions
+2 -2
View File
@@ -25,11 +25,11 @@ function ModelPs(model){
},
get(target, propKey, receiver) {
if(propKey == 'constructor') return target.constructor;
if(propKey === 'isproxy') return 'YESSSSSSSSS'
const targetValue = Reflect.get(target, propKey, receiver);
if (typeof targetValue === 'function') {
return function(...args){
let res = targetValue.apply(this, args); // (A)
// let res = targetValue.apply(this, args); // (A)
let res = Reflect.apply(targetValue, this, args);
if(targetValue.constructor.name === 'AsyncFunction'){
res.then(function(res){
publish(propKey, res, ...args);