import type { UpdateDemoOptimizationTaskMessage } from "@codeflash/types";
import type { State } from "../root";

export const updateDemoTask = (
  oldState: State,
  payload: UpdateDemoOptimizationTaskMessage["payload"],
): State => {
  return {
    ...oldState,
    demoOptTask: oldState.demoOptTask
      ? { ...oldState.demoOptTask, ...payload }
      : null,
  };
};
