Преглед на файлове

mol-plugin: added customState to PluginContext

David Sehnal преди 5 години
родител
ревизия
f5b09dbd10
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      src/mol-plugin/context.ts

+ 6 - 0
src/mol-plugin/context.ts

@@ -131,6 +131,12 @@ export class PluginContext {
         substructureParent: new SubstructureParentHelper(this)
     } as const;
 
+    /**
+     * Used to store application specific custom state which is then available
+     * to State Actions and similar constructs via the PluginContext.
+     */
+    readonly customState: any = Object.create(null);
+
     initViewer(canvas: HTMLCanvasElement, container: HTMLDivElement) {
         try {
             this.layout.setRoot(container);