Skip to content
module@warp-drive/core/reactive

Interface ReactiveErrorDocument<T> ​

Defined in: warp-drive-packages/core/src/reactive/-private/document.ts:116

The variant of ReactiveDocument returned for a request whose response contained no primary data, e.g. an error response.

Extends ​

  • ReactiveDocumentBase<T>

Type Parameters ​

T ​

T

Methods ​

fetch() ​

ts
fetch(options?): Promise<ReactiveDocument<T>>;

Defined in: warp-drive-packages/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 ​

Promise<ReactiveDocument<T>>

Inherited from ​

ts
ReactiveDocumentBase.fetch

first() ​

ts
first(options): Promise<ReactiveDocument<T> | null>;

Defined in: warp-drive-packages/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<ReactiveDocument<T> | null>

Inherited from ​

ts
ReactiveDocumentBase.first

last() ​

ts
last(options): Promise<ReactiveDocument<T> | null>;

Defined in: warp-drive-packages/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<ReactiveDocument<T> | null>

Inherited from ​

ts
ReactiveDocumentBase.last

next() ​

ts
next(options?): Promise<ReactiveDocument<T> | null>;

Defined in: warp-drive-packages/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<ReactiveDocument<T> | null>

Inherited from ​

ts
ReactiveDocumentBase.next

prev() ​

ts
prev(options): Promise<ReactiveDocument<T> | null>;

Defined in: warp-drive-packages/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<ReactiveDocument<T> | null>

Inherited from ​

ts
ReactiveDocumentBase.prev

toJSON() ​

ts
toJSON(): object;

Defined in: warp-drive-packages/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 ​

ts
ReactiveDocumentBase.toJSON

Properties ​

data? ​

ts
readonly optional data?: undefined;

Defined in: warp-drive-packages/core/src/reactive/-private/document.ts:128

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 ​

ts
readonly errors: object[];

Defined in: warp-drive-packages/core/src/reactive/-private/document.ts:135

The errors returned by the API for this request, if any


identifier ​

ts
readonly identifier: RequestKey | null;

Defined in: warp-drive-packages/core/src/reactive/-private/document.ts:48

The RequestKey associated with this document, if any

Inherited from ​

ts
ReactiveDocumentBase.identifier

ts
readonly optional links?: PaginationLinks;

Defined in: warp-drive-packages/core/src/reactive/-private/document.ts:34

The links object for this document, if any

e.g.

ts
{
  self: '/articles?page[number]=3',
}

Inherited from ​

ts
ReactiveDocumentBase.links

meta? ​

ts
readonly optional meta?: ObjectValue;

Defined in: warp-drive-packages/core/src/reactive/-private/document.ts:41

The meta object for this document, if any

Inherited from ​

ts
ReactiveDocumentBase.meta

Released under the MIT License.