Skip to content

Commit

Permalink
♻️ Refactor to use async_services
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Oct 27, 2020
1 parent bcc2639 commit adc0ff3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x-pack/plugins/lens/public/indexpattern_datasource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
DataPublicPluginStart,
} from '../../../../../src/plugins/data/public';
import { Datasource, EditorFrameSetup } from '../types';
import { formatColumn } from './format_column';

export interface IndexPatternDatasourceSetupPlugins {
expressions: ExpressionsSetup;
Expand All @@ -34,7 +33,9 @@ export class IndexPatternDatasource {
{ expressions, editorFrame, charts }: IndexPatternDatasourceSetupPlugins
) {
editorFrame.registerDatasource(async () => {
const { getIndexPatternDatasource, renameColumns } = await import('../async_services');
const { getIndexPatternDatasource, renameColumns, formatColumn } = await import(
'../async_services'
);
expressions.registerFunction(renameColumns);
expressions.registerFunction(formatColumn);
return core.getStartServices().then(([coreStart, { data }]) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export function uniqueLabels(layers: Record<string, IndexPatternLayer>) {
}

export * from './rename_columns';
export * from './format_column';

export function getIndexPatternDatasource({
core,
Expand Down

0 comments on commit adc0ff3

Please sign in to comment.