Skip to main content

Overview

Returns a function that fetches the total count of accepted connections for the currently authenticated user.

Usage Example

import { useFetchConnectionsCount } from "@replyke/react-js";

function ConnectionCount() {
  const fetchConnectionsCount = useFetchConnectionsCount();
  const [count, setCount] = useState<number | null>(null);

  useEffect(() => {
    fetchConnectionsCount().then((res) => setCount(res.count));
  }, []);

  return <span>{count ?? "..."} connections</span>;
}

Parameters

The hook returns a function that takes no parameters.

Returns

count
number
Total number of accepted connections for the current user.