Feeds a profile's lists of dumps, the user's own and those they upvoted, to its overview and to its "dumps" and "upvoted" tabs, and keeps them live.
Returns list of user userId, from GET /api/users/:userId/<list>, fetched
signed in so users see their own private dumps, with the call that loads its
next page; with categorySlug, only the dumps in that category. The socket
keeps it live: the user's new dumps come in, a dump that goes private and
public again comes back at its place, one edited out of the category
leaves, one edited into it comes in, and the upvoted list follows the
user's votes, source holding dumps at hand that a vote of theirs puts
first at once. A reconnection fetches the pages loaded again. The list and
the scroll position are saved as the page is left, under a key the overview
and the unfiltered tab share, and going back restores them.
Passed to useUserDumpFeed by the profile's overview and tabs.
-
categorySlug: string
Narrows the list to the category at this slug.
-
isOwner: boolean
Keeps the user's own private dumps in their list as they edit them.
-
source: Dump[]
Dumps at hand that a vote of the user's own puts first in their upvoted.
Returned by useUserDumpFeed.
-
cardClassName: (dump: Dump) => string | undefined
It goes to the list's
DumpCardList: on the upvoted list, it fades out a withdrawn upvote.
One of a profile's lists of dumps, a path segment of its API and page.
Usage
import * as mod from "src/hooks/dump/useUserDumpFeed.ts";