selectors.ts 326 B

1234567891011
  1. import { ApiKeysState } from 'app/types';
  2. export const getApiKeysCount = (state: ApiKeysState) => state.keys.length;
  3. export const getApiKeys = (state: ApiKeysState) => {
  4. const regex = RegExp(state.searchQuery, 'i');
  5. return state.keys.filter(key => {
  6. return regex.test(key.name) || regex.test(key.role);
  7. });
  8. };