Skip to main content

useFetchFollowersCount

Overview

The useFetchFollowersCount hook fetches the total number of users who are following the current logged-in user. This is useful for displaying follower counts in user profiles or dashboard statistics.

Usage Example

Advanced Usage with State

Usage in Dashboard

Parameters & Returns

Parameters

The hook returns a function that takes no parameters.

Returns

The function returns a Promise that resolves to an object containing:
count
number
The total number of users following you

Error Handling

The hook will throw errors in the following cases:
  • No project is specified
  • No user is logged in

Use Cases

This hook is commonly used in:
  • User profile pages to display follower counts
  • Dashboard statistics
  • Social media style metrics
  • Navigation badges showing follower numbers
  • Analytics and reporting features