function useDumpListSync
useDumpListSync(
items: Dump[],
setDumps: (fn: (prev: Dump[]) => Dump[]) => void,
): void

Applies the socket's dump, comment and user events to items, the loaded list, which setDumps updates. A deleted dump is removed, an edited one is replaced in place, one gone private leaves unless isOwner, and a new or returning one is added as belongs and addNew say. A new or deleted comment moves its dump's commentCount, and a renamed user's dumps take their new name.

Parameters

items: Dump[]
setDumps: (fn: (prev: Dump[]) => Dump[]) => void
optional
options: DumpListSyncOptions

Return Type

void

Usage

import { useDumpListSync } from "src/hooks/dump/useDumpListSync.ts";