vibe coded v1
This commit is contained in:
22
src/contexts/WSContext.ts
Normal file
22
src/contexts/WSContext.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { createContext } from "react";
|
||||
import type { Dump, OnlineUser } from "../model.ts";
|
||||
|
||||
export interface WSContextValue {
|
||||
onlineUsers: OnlineUser[];
|
||||
voteCounts: Record<string, number>;
|
||||
myVotes: Set<string>;
|
||||
recentDumps: Dump[];
|
||||
deletedDumpIds: Set<string>;
|
||||
castVote: (dumpId: string) => void;
|
||||
removeVote: (dumpId: string) => void;
|
||||
}
|
||||
|
||||
export const WSContext = createContext<WSContextValue>({
|
||||
onlineUsers: [],
|
||||
voteCounts: {},
|
||||
myVotes: new Set(),
|
||||
recentDumps: [],
|
||||
deletedDumpIds: new Set(),
|
||||
castVote: () => {},
|
||||
removeVote: () => {},
|
||||
});
|
||||
Reference in New Issue
Block a user