Files
goTorrent/goTorrentWebUI/node_modules/material-ui/ButtonBase/createRippleHandler.js.flow

24 lines
488 B
Plaintext

function createRippleHandler(instance, eventName, action, cb) {
return function handleEvent(event) {
if (cb) {
cb.call(instance, event);
}
if (event.defaultPrevented) {
return false;
}
if (instance.ripple) {
instance.ripple[action](event);
}
if (instance.props && typeof instance.props[`on${eventName}`] === 'function') {
instance.props[`on${eventName}`](event);
}
return true;
};
}
export default createRippleHandler;