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.
planka_custom/client/src/selectors/task.js

21 lines
382 B
JavaScript

import { createSelector } from 'redux-orm';
import orm from '../orm';
export const makeTaskByIdSelector = () =>
createSelector(
orm,
(_, id) => id,
({ Task }, id) => {
const taskModel = Task.withId(id);
if (!taskModel) {
return taskModel;
}
return taskModel.ref;
},
);
export const taskByIdSelector = makeTaskByIdSelector();