You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
599 B
26 lines
599 B
1 year ago
|
import { createSelector } from 'reselect';
|
||
|
import AppState from 'App/State/AppState';
|
||
|
|
||
|
function createLanguagesSelector() {
|
||
|
return createSelector(
|
||
|
(state: AppState) => state.settings.languages,
|
||
|
(languages) => {
|
||
|
const { isFetching, isPopulated, error, items } = languages;
|
||
|
|
||
|
const filterItems = ['Any'];
|
||
|
const filteredLanguages = items.filter(
|
||
|
(lang) => !filterItems.includes(lang.name)
|
||
|
);
|
||
|
|
||
|
return {
|
||
|
isFetching,
|
||
|
isPopulated,
|
||
|
error,
|
||
|
items: filteredLanguages,
|
||
|
};
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default createLanguagesSelector;
|