Documentation / @ember-data/request / index / withReactiveResponse
Function: withReactiveResponse()
ts
function withReactiveResponse<T>(obj): RequestInfo<ReactiveDataDocument<T>> & object;
Defined in: warp-drive-packages/core/declarations/request.d.ts:46
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
Returns
RequestInfo
<ReactiveDataDocument
<T
>> & object