Skip to content
Myr

front.ts

This file

Path

apps/web/src/client/front.ts

29 lines · 1.2 KiB · TypeScript

Last changed by

Merge redesign into mainoscabrielbefore adoptioncaedd21

History of this file

Take it

The walk stopped after 200 commits: lines older than 678c8b8 point at it.

Merge build/comments-web-rest into mainoscabrielbefore adoption0eb1248

line 1why, one step back
1// Each atom waits on the server unless a loader seeded it: a server render never fetches into the registry every request shares.

Merge redesign into mainoscabrielbefore adoptioncaedd21

line 2why, one step back
2import { useAtomValue } from "@effect/atom-react";

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 3why, one step back
3import type { Reserve } from "@repo/protocol/domain/ask";

Merge redesign into mainoscabrielbefore adoptioncaedd21

line 4why, one step back
4import type { ProjectListing } from "@repo/protocol/domain/front-page";

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 5why, one step back
5import type { KindName } from "@repo/protocol/ids";

Merge redesign into mainoscabrielbefore adoptioncaedd21

line 6why, one step back
6import { Atom, AsyncResult } 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 7–22why, one step back
7
8import { ContractsClient } from "../surfaces.ts";9import { keys } from "./keys.ts";1011export const frontPageAtom = Atom.family(12 (filter: { readonly kind?: KindName; readonly reserved?: Reserve }) =>13 Atom.withServerValueInitial(14 ContractsClient.query("frontPage", filter, {15 reactivityKeys: keys.front(),16 })17 )18);1920export const projectsAtom = Atom.withServerValueInitial(21 ContractsClient.query("listProjects", {}, { reactivityKeys: keys.front() })22);

Merge redesign into mainoscabrielbefore adoptioncaedd21

lines 23–29why, one step back
23
24/** Every project with its posture and open asks, read where it is shown, never by the shell on every page. */25export const useProjectList = (): readonly ProjectListing[] | undefined => {26 const listed = useAtomValue(projectsAtom);2728 return AsyncResult.isSuccess(listed) ? listed.value.projects : undefined;29};