mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Many UI Updates and Performance Tweaks
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import createDeepEqualSelector from './createDeepEqualSelector';
|
||||
import createClientSideCollectionSelector from './createClientSideCollectionSelector';
|
||||
|
||||
function createUnoptimizedSelector(uiSection) {
|
||||
return createSelector(
|
||||
createClientSideCollectionSelector('movies', uiSection),
|
||||
(movies) => {
|
||||
const items = movies.items.map((s) => {
|
||||
const {
|
||||
id,
|
||||
sortTitle
|
||||
} = s;
|
||||
|
||||
return {
|
||||
id,
|
||||
sortTitle
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
...movies,
|
||||
items
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function createMovieClientSideCollectionItemsSelector(uiSection) {
|
||||
return createDeepEqualSelector(
|
||||
createUnoptimizedSelector(uiSection),
|
||||
(movies) => movies
|
||||
);
|
||||
}
|
||||
|
||||
export default createMovieClientSideCollectionItemsSelector;
|
Reference in New Issue
Block a user