import { createSignal, createEffect, onCleanup } from "solid-js";
import { useZero } from "./use-zero.js";
function useConnectionState() {
  const zero = useZero();
  const [connectionState, setConnectionState] = createSignal(
    zero().connection.state.current
  );
  createEffect(() => {
    const unsubscribe = zero().connection.state.subscribe(setConnectionState);
    onCleanup(unsubscribe);
  });
  return connectionState;
}
export {
  useConnectionState
};
//# sourceMappingURL=use-connection-state.js.map
