Documentation / @warp-drive/core / reactive / ReactiveDataDocument
Interface: ReactiveDataDocument<T>
Defined in: core/src/reactive/-private/document.ts:132
Extends
ReactiveDocumentBase<T>
Type Parameters
T
T
Methods
fetch()
fetch(options?): Promise<ReactiveDocument<T>>;Defined in: core/src/reactive/-private/document.ts:57
Fetches the related link for this document, returning a promise that resolves with the document when the request completes. If no related link is present, will fallback to the self link if present
Parameters
options?
RequestInfo<ReactiveDocument<T>>
Returns
Inherited from
ReactiveDocumentBase.fetchfirst()
first(options): Promise<null | ReactiveDocument<T>>;Defined in: core/src/reactive/-private/document.ts:84
Fetches the first link for this document, returning a promise that resolves with the new document when the request completes, or null if there is no first link.
Parameters
options
RequestInfo<ReactiveDocument<T>>
Returns
Promise<null | ReactiveDocument<T>>
Inherited from
ReactiveDocumentBase.firstlast()
last(options): Promise<null | ReactiveDocument<T>>;Defined in: core/src/reactive/-private/document.ts:93
Fetches the last link for this document, returning a promise that resolves with the new document when the request completes, or null if there is no last link.
Parameters
options
RequestInfo<ReactiveDocument<T>>
Returns
Promise<null | ReactiveDocument<T>>
Inherited from
ReactiveDocumentBase.lastnext()
next(options?): Promise<null | ReactiveDocument<T>>;Defined in: core/src/reactive/-private/document.ts:66
Fetches the next link for this document, returning a promise that resolves with the new document when the request completes, or null if there is no next link.
Parameters
options?
RequestInfo<ReactiveDocument<T>>
Returns
Promise<null | ReactiveDocument<T>>
Inherited from
ReactiveDocumentBase.nextprev()
prev(options): Promise<null | ReactiveDocument<T>>;Defined in: core/src/reactive/-private/document.ts:75
Fetches the prev link for this document, returning a promise that resolves with the new document when the request completes, or null if there is no prev link.
Parameters
options
RequestInfo<ReactiveDocument<T>>
Returns
Promise<null | ReactiveDocument<T>>
Inherited from
ReactiveDocumentBase.prevtoJSON()
toJSON(): object;Defined in: core/src/reactive/-private/document.ts:107
Implemented for JSON.stringify support.
Returns the JSON representation of the document wrapper.
This is a shallow serialization, it does not deeply serialize the document's contents, leaving that to the individual record instances to determine how to do, if at all.
Returns
object
Inherited from
ReactiveDocumentBase.toJSONProperties
data
readonly data: T;Defined in: core/src/reactive/-private/document.ts:144
The primary data for this document, if any.
If this document has no primary data (e.g. because it is an error document) this property will be undefined.
For collections this will be an array of record instances, for single resource requests it will be a single record instance or null.
errors?
readonly optional errors: undefined;Defined in: core/src/reactive/-private/document.ts:151
The errors returned by the API for this request, if any
identifier
readonly identifier: null | RequestKey;Defined in: core/src/reactive/-private/document.ts:48
The RequestKey associated with this document, if any
Inherited from
ReactiveDocumentBase.identifierlinks?
readonly optional links: PaginationLinks;Defined in: core/src/reactive/-private/document.ts:34
The links object for this document, if any
e.g.
{
self: '/articles?page[number]=3',
}Inherited from
ReactiveDocumentBase.linksmeta?
readonly optional meta: ObjectValue;Defined in: core/src/reactive/-private/document.ts:41
The meta object for this document, if any
Inherited from
ReactiveDocumentBase.meta