mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
11 lines
379 B
TypeScript
11 lines
379 B
TypeScript
import { useSelector } from 'app/types';
|
|
|
|
import { UnifiedAlertingState } from '../state/reducers';
|
|
|
|
export function useUnifiedAlertingSelector<TSelected = unknown>(
|
|
selector: (state: UnifiedAlertingState) => TSelected,
|
|
equalityFn?: (left: TSelected, right: TSelected) => boolean
|
|
): TSelected {
|
|
return useSelector((state) => selector(state.unifiedAlerting), equalityFn);
|
|
}
|