import { useCallback } from 'react';
export function useHandleStepSave(graph) {
    return useCallback((step, index)=>{
        const isExistingStep = index != null && graph.numSteps > 0 && index < graph.numSteps;
        return isExistingStep ? graph.reconfigureStep(index, step) : graph.addStep(step);
    }, [
        graph
    ]);
}
