import { useEffect } from "react";
import { initializeAppControllerStateAction } from "../services/appControllerService";
import type { AppControllerContext } from "../services/appControllerService";

interface AppControllerLifecycleInput {
  appControllerContext: AppControllerContext;
}

export function useAppControllerLifecycle({ appControllerContext }: AppControllerLifecycleInput) {
  useEffect(() => {
    void initializeAppControllerStateAction(appControllerContext);
  }, [appControllerContext.artifactRepo, appControllerContext.captureRepo, appControllerContext.snapshotRepo, appControllerContext.isOverlay]);
}

