Documentation / @warp-drive/core / reactive / ReactiveDataDocument
Interface: ReactiveDataDocument<T>
Defined in: core/src/reactive/-private/document.ts:137
Extends
ReactiveDocumentBase
<T
>
Type Parameters
T
T
Methods
fetch()
fetch(options?): Promise<ReactiveDocument<T>>;
Defined in: core/src/reactive/-private/document.ts:62
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.fetch
first()
first(options): Promise<null | ReactiveDocument<T>>;
Defined in: core/src/reactive/-private/document.ts:89
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.first
last()
last(options): Promise<null | ReactiveDocument<T>>;
Defined in: core/src/reactive/-private/document.ts:98
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.last
next()
next(options?): Promise<null | ReactiveDocument<T>>;
Defined in: core/src/reactive/-private/document.ts:71
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.next
prev()
prev(options): Promise<null | ReactiveDocument<T>>;
Defined in: core/src/reactive/-private/document.ts:80
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.prev
toJSON()
toJSON(): object;
Defined in: core/src/reactive/-private/document.ts:112
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.toJSON
Properties
data
readonly data: T;
Defined in: core/src/reactive/-private/document.ts:149
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:156
The errors returned by the API for this request, if any
identifier
readonly identifier: null | RequestKey;
Defined in: core/src/reactive/-private/document.ts:53
The RequestKey associated with this document, if any
Inherited from
ReactiveDocumentBase.identifier
links?
readonly optional links: PaginationLinks;
Defined in: core/src/reactive/-private/document.ts:39
The links object for this document, if any
e.g.
{
self: '/articles?page[number]=3',
}
Inherited from
ReactiveDocumentBase.links
meta?
readonly optional meta: ObjectValue;
Defined in: core/src/reactive/-private/document.ts:46
The meta object for this document, if any
Inherited from
ReactiveDocumentBase.meta