@talend/react-containers
Version:
Provide connected components aka containers for @talend/react-cmf based on @talend/react-components.
22 lines • 506 B
JavaScript
import { get } from "lodash";
export default function getOnClick(item, props) {
if (item.href) {
return {};
}
if (!item.actionCreator && !get(item, 'payload.type')) {
return {};
}
return {
onClick(event, data) {
if (item.actionCreator) {
props.dispatchActionCreator(item.actionCreator, event, data);
} else {
props.dispatch({
model: props.model,
...item.payload
});
}
}
};
}
//# sourceMappingURL=actionOnClick.js.map