ask.ts
This file
Path
apps/web/src/client/ask.ts
24 lines · 812 bytes · TypeScript
Last changed by
Merge build/comments-web-rest into mainoscabrielbefore adoption0eb1248
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 1why, one step back1import type { AskId, ProjectName } from "@repo/protocol/ids";Finish the Control room: every page passes axe and a keyboard walk in both schemesoscabrielbefore adoption3fd50a5
line 2why, one step back2import { AsyncResult, Atom } from "effect/reactivity";Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 3–12why, one step back34import { ContractsClient } from "../surfaces.ts";5import { keys } from "./keys.ts";67export const askAtom = (project: ProjectName, ask: AskId) =>8 ContractsClient.query(9 "showAsk",10 { ask, project },11 { reactivityKeys: keys.ask(project, ask) }12 );Finish the Control room: every page passes axe and a keyboard walk in both schemesoscabrielbefore adoption3fd50a5
lines 13–19why, one step back1314type AskRead = Atom.Type<ReturnType<typeof askAtom>>;1516const unselected: Atom.Atom<AskRead> = Atom.make<AskRead>(17 AsyncResult.initial()18);19Merge build/comments-web-rest into mainoscabrielbefore adoption0eb1248
line 20why, one step back20// One atom either way, so a list that reads it keeps its rows when the selection moves.Finish the Control room: every page passes axe and a keyboard walk in both schemesoscabrielbefore adoption3fd50a5
lines 21–24why, one step back21export const selectedAskAtom = (22 pick: { readonly ask: AskId; readonly project: ProjectName } | undefined23): Atom.Atom<AskRead> =>24 pick === undefined ? unselected : askAtom(pick.project, pick.ask);