Browse Source

+cache of proxy on Savable

Ivan Asmer 4 years ago
parent
commit
8ae3c69780
1 changed files with 3 additions and 3 deletions
  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]