| import { TreeNodeList } from "@/TreeNodes/TreeNodeList/TreeNodeList"; |
| import { NameValPair } from "./StoreInterfaces"; |
|
|
| let store: any; |
|
|
| |
| |
| |
| |
| |
| export function setupExternalStoreAccess(_store: any) { |
| store = _store; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| export function setStoreVar(name: string, value: any, module = "") { |
| if (module === "") { |
| store.commit("setVar", { name: name, val: value } as NameValPair); |
| } else { |
| store.commit("setVar", { |
| name: name, |
| val: value, |
| module: module, |
| } as NameValPair); |
| } |
| } |
|
|
| |
| |
| |
| |
| |
| |
| export function pushToStoreList(name: string, value: any) { |
| store.commit("pushToList", { name: name, val: value } as NameValPair); |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| function getStoreVar(name: string, module = ""): any { |
| if (module === "") { |
| return store.state[name]; |
| } else { |
| return store.state[module][name]; |
| } |
| } |
|
|
| |
| |
| |
| |
| |
| export function getMoleculesFromStore(): TreeNodeList { |
| return getStoreVar("molecules") as TreeNodeList; |
| } |
|
|