Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mapStateToProps = (state, { record, resource }) => {
const hasRecord = record && record.id != undefined; // eslint-disable-line eqeqeq
return {
expanded: hasRecord ? getIsExpanded(state, resource, record.id) : false,
loading: hasRecord ? getIsLoading(state, resource, record.id) : false,
nodes: hasRecord ? getChildrenNodes(state, resource, record.id) : [],
};
};
const mapStateToProps = (state, { record, resource }) => {
const hasRecord = record && record.id != undefined; // eslint-disable-line eqeqeq
return {
expanded: hasRecord ? getIsExpanded(state, resource, record.id) : false,
loading: hasRecord ? getIsLoading(state, resource, record.id) : false,
nodes: hasRecord ? getChildrenNodes(state, resource, record.id) : [],
};
};
const mapStateToProps = (state, { record, resource }) => {
const hasRecord = record && record.id != undefined; // eslint-disable-line eqeqeq
return {
expanded: hasRecord ? getIsExpanded(state, resource, record.id) : false,
loading: hasRecord ? getIsLoading(state, resource, record.id) : false,
nodes: hasRecord ? getChildrenNodes(state, resource, record.id) : [],
};
};
const mapStateToProps = (state, props) => ({
nodeChildren:
props.record && props.record.id
? getChildrenNodes(state, props.resource, props.record.id)
: [],
});
resource: props.resource,
data: {
...draggedRecord,
[props.parentSource]: nodeParent,
[props.positionSource]: nodePosition,
},
parentSource: props.parentSource,
positionSource: props.positionSource,
previousData: draggedRecord,
basePath: props.basePath,
refresh: false,
redirectTo: undefined,
};
if (props.undoable) {
props.startUndoable(crudMoveNodeAction(actionPayload));
} else {
props.crudMoveNode(actionPayload);
}
},
};
const mapStateToProps = (state, { resource, nodes }) => ({
data: getTreeNodes(state, resource, nodes),
});