> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Fetch User Following Count

# `useFetchUserFollowingCount`

## Overview

The `useFetchUserFollowingCount` hook is used to retrieve the number of users a specific user is following within the current project. This is useful for displaying the number of connections or subscriptions a user has made.

## Usage Example

```tsx theme={null}
import { useFetchUserFollowingCount } from "@replyke/react-js";

function FollowingCountDisplay({ userId }: { userId: string }) {
  const fetchUserFollowingCount = useFetchUserFollowingCount();

  const handleFetchFollowingCount = async () => {
    try {
      const { count } = await fetchUserFollowingCount({ userId });
      console.log(`User is following ${count} users.`);
    } catch (error) {
      console.error("Failed to fetch following count:", error.message);
    }
  };

  return (
    <button onClick={handleFetchFollowingCount}>Get Following Count</button>
  );
}
```

## Parameters & Returns

### Parameters

The hook returns a function that accepts the following parameter:

<ParamField path="userId" type="string" required>
  The ID of the user to fetch following count for.
</ParamField>

### Returns

The function resolves with an object containing the following count:

<ResponseField name="response.count" type="number">
  The number of users the specified user is following.
</ResponseField>
