Skip to content

Commit

Permalink
Make the actual Vislib import async (#78949)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
Tim Roes and elasticmachine committed Oct 1, 2020
1 parent d8ded4d commit 9b187c5
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 9b187c5

Please sign in to comment.