Files
planka/client/src/selectors/project-managers.js
Maksim Eltyshev 3714bbc06f ref: Refactoring
2022-08-04 13:31:14 +02:00

26 lines
547 B
JavaScript

import { createSelector } from 'redux-orm';
import orm from '../orm';
export const makeSelectProjectManagerById = () =>
createSelector(
orm,
(_, id) => id,
({ ProjectManager }, id) => {
const projectManagerModel = ProjectManager.withId(id);
if (!projectManagerModel) {
return projectManagerModel;
}
return projectManagerModel.ref;
},
);
export const selectProjectManagerById = makeSelectProjectManagerById();
export default {
makeSelectProjectManagerById,
selectProjectManagerById,
};