Skip to content

Commit

Permalink
Make the actual Vislib import async
Browse files Browse the repository at this point in the history
  • Loading branch information
timroes committed Sep 30, 2020
1 parent 6771279 commit 64e6f02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/vis_type_vislib/public/vis_controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import $ from 'jquery';
import React, { RefObject } from 'react';

// @ts-ignore
import { Vis as Vislib } from './vislib/vis';
import { Positions } from './utils/collections';
import { VisTypeVislibDependencies } from './plugin';
import { mountReactNode } from '../../../core/public/utils';
Expand Down Expand Up @@ -80,6 +78,9 @@ export const createVislibVisController = (deps: VisTypeVislibDependencies) => {
return resolve();
}

// @ts-expect-error
const { Vis: Vislib } = await import('./vislib/vis');

this.vislibVis = new Vislib(this.chartEl, visParams, deps);
this.vislibVis.on('brush', this.vis.API.events.brush);
this.vislibVis.on('click', this.vis.API.events.filter);
Expand Down

0 comments on commit 64e6f02

Please sign in to comment.