소스 검색

+cache of proxy on Savable

Ivan Asmer 5 년 전
부모
커밋
8ae3c69780
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      index.js

+ 3 - 3
index.js

@@ -321,7 +321,7 @@ const mm = db => {
 
 
         static get m(){ 
-            return (new Proxy({}, {
+            return Savable._m = (Savable._m || (new Proxy({}, {
                 get(obj, _class){
                     if (_class in obj){
                         return obj[_class]
@@ -369,7 +369,7 @@ const mm = db => {
 
                 set(obj, propName, value){
                 }
-            }))
+            })))
         }
 
         static get relations(){ 
@@ -504,7 +504,7 @@ const mm = db => {
                 }
 
             static get m() {
-                return SlicedSavable._m = (SlicedSavable._m || (new Proxy({}, {
+                return SlicedSavable._sm = (SlicedSavable._sm || (new Proxy({}, {
                         get(obj, _class){
                                 if (_class in obj){
                                         return obj[_class]