Skip to main content

Overview

Returns a function that fetches the total count of users the currently authenticated user follows. For getting another user’s following count, see useFetchFollowingCountByUserId.

Usage Example

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

function FollowingCount() {
  const fetchFollowingCount = useFetchFollowingCount();
  const [count, setCount] = useState<number | null>(null);

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

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

Parameters

The hook returns a function that takes no parameters.

Returns

count
number
Total number of users the current user is following.