Skip to content

Documentation / @ember-data/request / index / Future

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:34

A Future is a Promise which resolves to a StructuredDocument while providing the ability to abort the underlying request, getStream the response before the outer promise resolves;

Future

Extends

Type Parameters

T

T

Properties

___(unique) Symbol(IS_FUTURE)

ts
___(unique) Symbol(IS_FUTURE): true;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:35


[toStringTag]

ts
readonly [toStringTag]: string;

Defined in: node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:176

Inherited from

ts
Promise.[toStringTag]

id

ts
id: number;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:77

The id of the associated request, if any, as assigned by the RequestManager


lid

ts
lid: 
  | null
  | StableDocumentIdentifier;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:68

The identifier of the associated request, if any, as assigned by the CacheHandler.

Methods

abort()

ts
abort(reason?): void;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:43

Cancel this request by firing the AbortController's signal.

Parameters

reason?

string

optional reason for aborting the request

Returns

void


catch()

ts
catch<TResult>(onrejected?): Promise<StructuredDataDocument<T> | TResult>;

Defined in: node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1557

Attaches a callback for only the rejection of the Promise.

Type Parameters

TResult

TResult = never

Parameters

onrejected?

The callback to execute when the Promise is rejected.

null | (reason) => TResult | PromiseLike<TResult>

Returns

Promise<StructuredDataDocument<T> | TResult>

A Promise for the completion of the callback.

Inherited from

ts
Promise.catch

finally()

ts
finally(onfinally?): Promise<StructuredDataDocument<T>>;

Defined in: node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.promise.d.ts:29

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

Parameters

onfinally?

The callback to execute when the Promise is settled (fulfilled or rejected).

null | () => void

Returns

Promise<StructuredDataDocument<T>>

A Promise for the completion of the callback.

Inherited from

ts
Promise.finally

getStream()

ts
getStream(): Promise<null | ReadableStream<any>>;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:50

Get the response stream, if any, once made available.

Returns

Promise<null | ReadableStream<any>>


onFinalize()

ts
onFinalize(cb): void;

Defined in: warp-drive-packages/core/declarations/request/-private/types.d.ts:59

Run a callback when this request completes. Use sparingly, mostly useful for instrumentation and infrastructure.

Parameters

cb

() => void

the callback to run

Returns

void


then()

ts
then<TResult1, TResult2>(onfulfilled?, onrejected?): Promise<TResult1 | TResult2>;

Defined in: node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1550

Attaches callbacks for the resolution and/or rejection of the Promise.

Type Parameters

TResult1

TResult1 = StructuredDataDocument<T>

TResult2

TResult2 = never

Parameters

onfulfilled?

The callback to execute when the Promise is resolved.

null | (value) => TResult1 | PromiseLike<TResult1>

onrejected?

The callback to execute when the Promise is rejected.

null | (reason) => TResult2 | PromiseLike<TResult2>

Returns

Promise<TResult1 | TResult2>

A Promise for the completion of which ever callback is executed.

Inherited from

ts
Promise.then

Released under the MIT License.