mirror of
https://github.com/plankanban/planka.git
synced 2025-12-24 17:25:00 +03:00
26 lines
448 B
JavaScript
26 lines
448 B
JavaScript
import { createSelector } from 'redux-orm';
|
|
|
|
import orm from '../orm';
|
|
|
|
export const makeSelectLabelById = () =>
|
|
createSelector(
|
|
orm,
|
|
(_, id) => id,
|
|
({ Label }, id) => {
|
|
const labelModel = Label.withId(id);
|
|
|
|
if (!labelModel) {
|
|
return labelModel;
|
|
}
|
|
|
|
return labelModel.ref;
|
|
},
|
|
);
|
|
|
|
export const selectLabelById = makeSelectLabelById();
|
|
|
|
export default {
|
|
makeSelectLabelById,
|
|
selectLabelById,
|
|
};
|