All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.buttons.StandardButton.withPerformAction.js Maven / Gradle / Ivy

The newest version!
import { compose } from 'recompose'

import withActionButton from '../withActionButton'

export const withPerformAction = compose(
    withActionButton({
        onClick: (e, props) => {
            const { action, onClick, dispatch, actionCallback } = props

            if (actionCallback) {
                actionCallback()
            }

            if (action) {
                dispatch(action)
            }

            if (onClick) {
                onClick(e)
            }
        },
    }),
)

export default withPerformAction




© 2015 - 2024 Weber Informatics LLC | Privacy Policy