grafana/public/app/features/plugins/state/selectors.ts
Tobias Skarhed c8498461a5 noImplicitAny: Down approx 200 errors (#18143)
* noImplicitAny playlist approx 200

* Add AngularPanelMenuItem interface

* Roughly 100 noImplicitAny
2019-07-18 08:03:04 +02:00

13 lines
468 B
TypeScript

import { PluginsState } from 'app/types/plugins';
export const getPlugins = (state: PluginsState) => {
const regex = new RegExp(state.searchQuery, 'i');
return state.plugins.filter(item => {
return regex.test(item.name) || regex.test(item.info.author.name) || regex.test(item.info.description);
});
};
export const getPluginsSearchQuery = (state: PluginsState) => state.searchQuery;
export const getLayoutMode = (state: PluginsState) => state.layoutMode;