grafana/public/app/features/panel/state/selectors.ts
Torkel Ödegaard d62ca1283c
PanelState: Introduce a new separate redux panel state not keyed by panel.id (#40302)
* Initial pass to move panel state to it's own, and make it by key not panel.id

* Progress

* Not making much progress, having panel.key be mutable is causing a lot of issues

* Think this is starting to work

* Began fixing tests

* Add selector

* Bug fixes and changes to cleanup, and fixing all flicking when switching library panels

* Removed console.log

* fixes after merge

* fixing tests

* fixing tests

* Added new test for changePlugin thunk
2021-10-13 08:53:36 +02:00

8 lines
279 B
TypeScript

import { PanelModel } from 'app/features/dashboard/state';
import { StoreState } from 'app/types';
import { PanelState } from './reducers';
export function getPanelStateForModel(state: StoreState, model: PanelModel): PanelState | undefined {
return state.panels[model.key];
}