grafana/public/test/helpers/getTemplateSrvDependencies.ts

10 lines
527 B
TypeScript
Raw Normal View History

import { getFilteredVariables, getVariables, getVariableWithName } from '../../app/features/variables/state/selectors';
import { StoreState } from '../../app/types';
import { TemplateSrvDependencies } from 'app/features/templating/template_srv';
export const getTemplateSrvDependencies = (state: StoreState): TemplateSrvDependencies => ({
getFilteredVariables: (filter) => getFilteredVariables(filter, state),
getVariableWithName: (name) => getVariableWithName(name, state),
getVariables: () => getVariables(state),
});