mirror of
https://github.com/zoriya/flood.git
synced 2026-05-31 18:25:25 +00:00
Insert state into strategic components rather than entire app
This commit is contained in:
@@ -9,7 +9,9 @@ const torrentListSortBy = state => state.ui.torrentList.sortBy;
|
||||
|
||||
const torrentListFilterBy = state => state.ui.torrentList.filterBy;
|
||||
|
||||
const torrentList = state => state.torrents;
|
||||
const selectedTorrents = state => state.torrents.selectedTorrents;
|
||||
|
||||
const torrentList = state => state.torrents.torrents;
|
||||
|
||||
const filteredTorrents = createSelector(
|
||||
torrentListFilterBy,
|
||||
@@ -27,12 +29,23 @@ const searchedTorrents = createSelector(
|
||||
}
|
||||
);
|
||||
|
||||
const torrentSelector = createSelector(
|
||||
torrentListSortBy,
|
||||
const sortedTorrents = createSelector(
|
||||
searchedTorrents,
|
||||
(torrentListSortBy, searchedTorrents) => {
|
||||
torrentListSortBy,
|
||||
(searchedTorrents, torrentListSortBy) => {
|
||||
return sortTorrents(searchedTorrents, torrentListSortBy);
|
||||
}
|
||||
);
|
||||
|
||||
const torrentSelector = createSelector(
|
||||
selectedTorrents,
|
||||
sortedTorrents,
|
||||
(selectedTorrents, sortedTorrents) => {
|
||||
return {
|
||||
selectedTorrents,
|
||||
torrents: sortedTorrents
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export default torrentSelector;
|
||||
|
||||
Reference in New Issue
Block a user