I am using react-reselect to filter out some data. I have to different arrays of data which I have to check if they are matching or not. How can I do a filter with two different arrays and have to run map function on them
Here is my selector
export const AssignedUserSelector = createSelector(
[EmployeeSelector],
employee => {
const freshData = newData.map(newlyAssign => newlyAssign);
return employee.employees.filter(assign => assign.employeeId === newData);
}
);
here freshdata is something like this ["2222","333", "4444"] and employee.employees is like this [{id:"222", name: "John"}, {id:"333", name: "Jane"}, {id:"5555", name: "Josh"}].
What I am trying to do is filter out employees as per the id received. How I can I achieve this in react.