import { useContext } from "react";
import AppContext from "./AppContext.js";
import { signal } from "@preact/signals-react";
const cos = signal();
const cosConfig = cos.value;
const useAppState = (initialOpts) => {
  const contextApp = useContext(AppContext);
  const client = contextApp || initialOpts;
  if (client.cosConfig) {
    cos.value = client.cosConfig;
  }
  return {
    ...client
  };
};
export {
  cosConfig,
  useAppState as default,
  useAppState
};
//# sourceMappingURL=useAppState.js.map
