Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createViewer(container, proxyConfig = null) {
const proxyConfiguration = proxyConfig || activeProxyConfig || Config.Proxy;
const proxyManager = vtkProxyManager.newInstance({ proxyConfiguration });
const store = createStore(proxyManager);
// subscription won't be unsubscribed b/c we currently
// don't have a way to destroy a viewer
registerProxyManagerHooks(proxyManager, store);
/* eslint-disable no-new */
new Vue({
el: container,
components: { App },
store,
vuetify: new Vuetify(),
template: '',
});
function createStore(proxyManager = null) {
let pxm = proxyManager;
if (!proxyManager) {
pxm = vtkProxyManager.newInstance({
proxyConfiguration: Config.Proxy,
});
}
return new Vuex.Store({
state: {
proxyManager: pxm,
route: 'landing', // valid values: landing, app
savingStateName: null,
loadingState: false,
panels: {},
},
modules: getModuleDefinitions(),
mutations: {
SHOW_LANDING(state) {
state.route = 'landing';
},