Browse Source

added .props() to CustomProperty.Provider

Alexander Rose 5 years ago
parent
commit
5c4c4811e4

+ 2 - 1
src/mol-model-props/common/custom-model-property.ts

@@ -69,7 +69,8 @@ namespace CustomModelProperty {
                     // this invalidates property.value
                     set(data, p, undefined)
                 }
-            }
+            },
+            props: (data: Model) => get(data).props,
         }
     }
 }

+ 1 - 0
src/mol-model-props/common/custom-property.ts

@@ -35,6 +35,7 @@ namespace CustomProperty {
         readonly ref: (data: Data, add: boolean) => void
         readonly get: (data: Data) => ValueBox<Value | undefined>
         readonly set: (data: Data, props: PD.Values<Params>, value?: Value) => void
+        readonly props: (data: Data) => PD.Values<Params>
     }
 
     export class Registry<Data> {

+ 2 - 1
src/mol-model-props/common/custom-structure-property.ts

@@ -72,7 +72,8 @@ namespace CustomStructureProperty {
                     // this invalidates property.value
                     set(data, p, value)
                 }
-            }
+            },
+            props: (data: Structure) => get(data).props,
         }
     }
 }