You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
320 B
16 lines
320 B
import _ from 'lodash';
|
|
|
|
function getSelectedIds(selectedState, { parseIds = true } = {}) {
|
|
return _.reduce(selectedState, (result, value, id) => {
|
|
if (value) {
|
|
const parsedId = parseIds ? parseInt(id) : id;
|
|
|
|
result.push(parsedId);
|
|
}
|
|
|
|
return result;
|
|
}, []);
|
|
}
|
|
|
|
export default getSelectedIds;
|