@redux-devtools/rtk-query-monitor
Version:
rtk-query monitor for Redux DevTools
17 lines (13 loc) • 357 B
text/typescript
import { TabOption } from '../types';
export function isTabVisible<St, Props, Vis extends string>(
tab: TabOption<St, Props, Vis>,
visKey: Vis | 'default',
): boolean {
if (typeof tab.visible === 'boolean') {
return tab.visible;
}
if (typeof tab.visible === 'object' && tab.visible) {
return !!tab.visible[visKey];
}
return true;
}