Skip to content

Documentation / @warp-drive/core / reactive / ReactiveErrorDocument

Interface: ReactiveErrorDocument<T>

Defined in: core/src/reactive/-private/document.ts:115

Extends

  • ReactiveDocumentBase<T>

Type Parameters

T

T

Methods

fetch()

ts
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

Promise<ReactiveDocument<T>>

Inherited from

ts
ReactiveDocumentBase.fetch

first()

ts
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

ts
ReactiveDocumentBase.first

last()

ts
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

ts
ReactiveDocumentBase.last

next()

ts
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

ts
ReactiveDocumentBase.next

prev()

ts
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

ts
ReactiveDocumentBase.prev

toJSON()

ts
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

ts
ReactiveDocumentBase.toJSON

Properties

data?

ts
readonly optional data: undefined;

Defined in: core/src/reactive/-private/document.ts:127

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: core/src/reactive/-private/document.ts:134

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


identifier

ts
readonly identifier: null | RequestKey;

Defined in: core/src/reactive/-private/document.ts:53

The RequestKey associated with this document, if any

Inherited from

ts
ReactiveDocumentBase.identifier

ts
readonly optional links: PaginationLinks;

Defined in: core/src/reactive/-private/document.ts:39

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: core/src/reactive/-private/document.ts:46

The meta object for this document, if any

Inherited from

ts
ReactiveDocumentBase.meta

Released under the MIT License.