keys.ts
This file
Path
apps/web/src/client/keys.ts
21 lines · 1.0 KiB · TypeScript
Last changed by
Merge build/comments-web-rest into mainoscabrielbefore adoption0eb1248
History of this fileTake it
12345678910111213141516171819202122// Each key is one string: Reactivity treats every element of a key list as a key of its own.import type { AskId, ProjectName, ProposalId } from "@repo/protocol/ids";
export const keys = { ask: (project: ProjectName, ask: AskId): readonly string[] => [ `ask:${project}/${ask}`, `project:${project}`, ], code: (project: ProjectName): readonly string[] => [`code:${project}`], // Not the project's key, so a page's reads can refetch without replaying every event. events: (project: ProjectName): readonly string[] => [`events:${project}`], front: (): readonly string[] => ["front"], ledger: (project: ProjectName): readonly string[] => [`ledger:${project}`], policy: (project: ProjectName): readonly string[] => [`policy:${project}`], project: (project: ProjectName): readonly string[] => [`project:${project}`], proposal: (project: ProjectName, proposal: ProposalId): readonly string[] => [ `proposal:${project}/${proposal}`, `project:${project}`, ], today: (): readonly string[] => ["today"],};