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

type HandlerType = Handler<{
    isPlacingOrder: boolean;
}>;

export const DispatchSetIsPlacingOrder: HandlerType = props => {
    props.dispatch({
        type: "Pages/OnePageCheckout/SetIsPlacingOrder",
        isPlacingOrder: props.parameter.isPlacingOrder,
    });
};

export const chain = [DispatchSetIsPlacingOrder];

const setIsPlacingOrder = createHandlerChainRunner(chain, "SetIsPlacingOrder");
export default setIsPlacingOrder;
