@talend/react-cmf
Version:
A framework built on top of best react libraries
14 lines • 571 B
JavaScript
import Immutable from 'immutable';
import { get } from "lodash";
export default function getAllOfFunction(statePath) {
return function includes({
context
}, immutablePath, values) {
if (!Array.isArray(values)) {
throw new Error('You should pass an array of values to check if all of them are present');
}
const arr = get(context.store.getState(), statePath, new Immutable.Map()).getIn(immutablePath.split('.'), new Immutable.List());
return arr.size > 0 && arr.every(value => values.includes(value));
};
}
//# sourceMappingURL=allOf.js.map