You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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,
|
|
};
|