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
437 B
JavaScript
26 lines
437 B
JavaScript
import { createSelector } from 'redux-orm';
|
|
|
|
import orm from '../orm';
|
|
|
|
export const makeSelectTaskById = () =>
|
|
createSelector(
|
|
orm,
|
|
(_, id) => id,
|
|
({ Task }, id) => {
|
|
const taskModel = Task.withId(id);
|
|
|
|
if (!taskModel) {
|
|
return taskModel;
|
|
}
|
|
|
|
return taskModel.ref;
|
|
},
|
|
);
|
|
|
|
export const selectTaskById = makeSelectTaskById();
|
|
|
|
export default {
|
|
makeSelectTaskById,
|
|
selectTaskById,
|
|
};
|