forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

getBoardStrokes.ts16 lines, 565 bytesHistoryRawDownload
1import { client, normalizePage, pageQuery, type Page, type PageParams } from "../client";
2import type { StrokeRow } from "./types";
3
4// The live canvas: the current epoch's strokes, oldest first. REST catch-up
5// / fallback for the same canvas the socket replays.
6export async function getBoardStrokes(
7 id: string,
8 params?: PageParams,
9 signal?: AbortSignal,
10): Promise<Page<StrokeRow>> {
11 const data = await client<unknown>(
12 `/boards/${encodeURIComponent(id)}/strokes${pageQuery(params)}`,
13 { signal },
14 );
15 return normalizePage<StrokeRow>(data);
16}