UNPKG

@talend/react-components

Version:
28 lines (26 loc) 581 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = wrapOnClick; /** * @typedef {Object} ActionProps * @property {TYPE_DROPDOWN | TYPE_SPLIT_DROPDOWN | TYPE_ICON_TOGGLE | TYPE_FILE} displayMode * @property {Object.<String, Component>} renderers */ function noOp() {} function wrapOnClick(action) { const { model, onClick, ...rest } = action; const eventHandler = onClick || noOp; return event => eventHandler(event, { action: { ...rest }, model }); } //# sourceMappingURL=wrapOnClick.js.map