grafana/public/app/features/dashboard/state/selectors.ts
Torkel Ödegaard 70b0ec65b3
PanelEdit: Fixed timing and state related issues (#22131)
* PanelEdit: Fixed timing and state related issues

* Added unit test and changed some logic

* Fixed id logic

* Updated snapshots

* Update public/app/features/dashboard/state/PanelModel.ts

Co-Authored-By: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-02-13 16:06:45 +01:00

10 lines
253 B
TypeScript

import { DashboardState, PanelState } from 'app/types';
export function getPanelStateById(state: DashboardState, panelId: number): PanelState {
if (!panelId) {
return {} as PanelState;
}
return state.panels[panelId] ?? ({} as PanelState);
}