import { createHandlerChainRunner, Handler } from "@insite/client-framework/HandlerCreator";

type HandlerType = Handler<{ validateForm: () => boolean }>;

export const DispatchSetValidateForm: HandlerType = props => {
    props.dispatch({
        type: "Pages/CheckoutReviewAndSubmit/SetValidateForm",
        validateForm: props.parameter.validateForm,
    });
};

export const chain = [DispatchSetValidateForm];

const setValidateForm = createHandlerChainRunner(chain, "SetValidateForm");
export default setValidateForm;
