useNavModel.ts 352 B

1234567891011
  1. import { useSelector } from 'react-redux';
  2. import { NavModel } from '@grafana/data';
  3. import { StoreState } from 'app/types/store';
  4. import { getNavModel } from '../selectors/navModel';
  5. export const useNavModel = (id: string): NavModel => {
  6. const navIndex = useSelector((state: StoreState) => state.navIndex);
  7. return getNavModel(navIndex, id);
  8. };