mirror of
https://github.com/zoriya/flood.git
synced 2025-12-21 06:35:14 +00:00
Rearrange app directory structure
This commit is contained in:
43
client/source/scripts/selectors/uiSelector.js
Normal file
43
client/source/scripts/selectors/uiSelector.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
const fetchingData = state => state.ui.fetchingData;
|
||||
|
||||
const torrentListCount = state => state.ui.torrentList.count;
|
||||
|
||||
const torrentListSelected = state => state.ui.torrentList.selected;
|
||||
|
||||
const torrentListSearchString = state => state.ui.torrentList.searchString;
|
||||
|
||||
const torrentListSortBy = state => state.ui.torrentList.sortBy;
|
||||
|
||||
const torrentListFilterBy = state => state.ui.torrentList.filterBy;
|
||||
|
||||
const torrentList = createSelector(
|
||||
torrentListCount,
|
||||
torrentListSearchString,
|
||||
torrentListSelected,
|
||||
torrentListSortBy,
|
||||
torrentListFilterBy,
|
||||
(count, searchString, selected, sortBy, filterBy) => {
|
||||
return {
|
||||
count,
|
||||
searchString,
|
||||
selected,
|
||||
sortBy,
|
||||
filterBy
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const uiSelector = createSelector(
|
||||
fetchingData,
|
||||
torrentList,
|
||||
(fetchingData, torrentList) => {
|
||||
return {
|
||||
fetchingData,
|
||||
torrentList
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export default uiSelector;
|
||||
Reference in New Issue
Block a user