interface PlaylistEvent

Keeps the playlists on screen up to date, in lists, on a playlist's page and on a dump's page. WSProvider emits it as a playlist event on each playlist_* message; lists apply it through usePlaylistListSync, a playlist's page through usePlaylist. Which fields are set depends on type.

Properties

type: "created" | "updated" | "deleted" | "dumps_updated"
playlistId: string

Set when created or updated.

optional
userId: string

The owner's id, set when deleted.

optional
dumpIds: string[]

Set when the dumps changed. It lists only the dumps this user may see, in order.

optional
lastDumpAt: Date

With dumpIds, when the latest of them was added; undefined when there is none.

Usage

import { type PlaylistEvent } from "src/contexts/ws/WSContext.ts";