parent
2e6094beb6
commit
b54d556e63
@ -0,0 +1,16 @@
|
|||||||
|
import { createSelector } from 'reselect';
|
||||||
|
import getSectionState from 'Utilities/State/getSectionState';
|
||||||
|
function createSortedSectionSelector(section, comparer) {
|
||||||
|
return createSelector(
|
||||||
|
(state) => state,
|
||||||
|
(state) => {
|
||||||
|
const sectionState = getSectionState(state, section, true);
|
||||||
|
return {
|
||||||
|
...sectionState,
|
||||||
|
items: [...sectionState.items].sort(comparer)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default createSortedSectionSelector;
|
Loading…
Reference in new issue