Skip to content

docs: propose custom-response-object change - #5

Merged
joeykamsteeg merged 4 commits into
developfrom
claude/custom-response-object-6tq3ei
Aug 2, 2026
Merged

docs: propose custom-response-object change#5
joeykamsteeg merged 4 commits into
developfrom
claude/custom-response-object-6tq3ei

Conversation

@joeykamsteeg

Copy link
Copy Markdown
Member

Adds proposal, design, tasks, and an http-client spec delta for
wrapping createFetchify's HTTP methods in a FetchifyResponse
{ data, response } object instead of returning the raw fetch Response.

claude added 4 commits August 2, 2026 00:23
Adds proposal, design, tasks, and an http-client spec delta for
wrapping createFetchify's HTTP methods in a FetchifyResponse
{ data, response } object instead of returning the raw fetch Response.
FetchifyResponse<T = string> and FetchifyMethod<T> let callers write
client.get<User>("/user") and get a typed, JSON-parsed data property
(falling back to raw text for non-JSON bodies).
Each client method now resolves to { data, response } instead of the
raw fetch Response. data is the parsed body (JSON with a text
fallback) when the response is ok, or null otherwise; response is an
unread clone of the original Response for callers who need json()/
blob()/status/headers directly. Methods accept an optional generic
(client.get<User>("/user")) to type data.

BREAKING CHANGE: FetchifyMethod's return type changed from
Promise<Response> to Promise<FetchifyResponse<T>>.
DOCS.md was still describing createFetchify's methods as returning
the raw fetch Response.
@joeykamsteeg
joeykamsteeg merged commit 67d87c1 into develop Aug 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants