Service Layer medium complexity frontend
1
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Frontend data-fetching layer built on React Query (or SWR) that manages server state for the activity feed. Handles cursor-based infinite scroll, cache invalidation on approval/flag mutations, and optimistic UI updates so status changes appear instantly before the server confirms. Provides polling configuration for near-real-time feed refresh.

Feature: Activity Feed

activity-feed-client

Responsibilities

  • Fetch paginated feed pages using React Query useInfiniteQuery
  • Apply optimistic updates for approve and flag mutations
  • Invalidate and refetch feed after confirmed mutations
  • Expose polling interval configuration for real-time updates

Interfaces

useActivityFeed(filters): { items, fetchNextPage, hasNextPage, isLoading }
useApproveActivity(): MutationResult
useFlagActivity(): MutationResult
invalidateFeedCache()
prefetchFeedPage(cursor)
setPollingInterval(ms)

Relationships

Dependencies (1)

Components this component depends on