Skip to content

Documentation / @warp-drive/core / request / withReactiveResponse

Function: withReactiveResponse()

ts
function withReactiveResponse<T>(obj): RequestInfo<ReactiveDataDocument<T>> & object;

Defined in: core/src/request.ts:58

Brands the supplied object with the supplied response type wrapped in ReactiveDataDocument. This is a convenience for the common case of using withResponseType with ReactiveDataDocument.

ts
import { withReactiveResponse } from '@warp-drive/core/request';
import type { User } from '#/data/user.ts'

const result = await store.request(
  withReactiveResponse<User>({ url: '/users/1' })
);

result.content.data; // will have type User

Type Parameters

T

T

Parameters

obj

RequestInfo

Returns

RequestInfo<ReactiveDataDocument<T>> & object

Released under the MIT License.