Class Document
publicA Document is a class that wraps the response content from a request to the API
returned by Cache.put
or Cache.peek
, converting resource-identifiers into
record instances.
It is not directly instantiated by the user, and its properties should not be directly modified. Whether individual properties are mutable or not is determined by the record instance itself.
fetch (options) public
Defined in ../packages/store/src/-private/document.ts:110
- options
- Object
- returns
Promise
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
first (options) public
Defined in ../packages/store/src/-private/document.ts:155
- options
- Object
- returns
Promise
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.
last (options) public
Defined in ../packages/store/src/-private/document.ts:169
- options
- Object
- returns
Promise
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.
next (options) public
Defined in ../packages/store/src/-private/document.ts:127
- options
- Object
- returns
Promise
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.
prev (options) public
Defined in ../packages/store/src/-private/document.ts:141
- options
- Object
- returns
Promise
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.
toJSON public
Defined in ../packages/store/src/-private/document.ts:183
- returns
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.