mirror of
https://github.com/grafana/grafana.git
synced 2025-02-03 12:11:09 -06:00
13 lines
313 B
TypeScript
13 lines
313 B
TypeScript
|
import { StoreState } from '../../app/types';
|
||
|
|
||
|
export const convertToStoreState = (variables: any[]): StoreState => {
|
||
|
return {
|
||
|
templating: {
|
||
|
variables: variables.reduce((byName, variable) => {
|
||
|
byName[variable.name] = variable;
|
||
|
return byName;
|
||
|
}, {}),
|
||
|
},
|
||
|
} as StoreState;
|
||
|
};
|