Constructor
Fcnew FetchResponse(request, metaopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
request |
FetchRequest
|
A reference to the data fetch request object this response answers. |
|
meta |
Object
|
<optional> |
an object contaning metadata |
Throws:
-
a validation error is thrown if parameter validation fails.
- Type
-
external:validateParams.ValidationError
Methods
FallMeta() → {Object}
A read-only accessor method to get all metadata. A shallow copy is returned.
- See:
-
- external:validateParams.shallowCopy
Returns:
- Type:
-
Object
FdataPromise(dataPromiseopt) → {Promise}
A read/write accessor for the promise of the data associated with this response.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dataPromise |
Promise
|
<optional> |
if present, this function will behave as a setter. |
Throws:
-
a type error is thrown if a parameter is passed and it's not a promise.
- Type
-
TypeError
Returns:
- Type:
-
Promise
Regardless of whether or not a new promise was passed,
if there is a current data promise it will be returned, otherwise,
undefined
will be returned.
Fmeta(metaName, newValopt)
A read/write accessor for individual pieces of metadata associated with this response.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
metaName |
string
|
the name of desired piece of metadata. |
|
newVal |
*
|
<optional> |
if present, will set the value of the requested piece of metadata to this value. |
Throws:
-
a validation error is thrown if parameter validation fails.
- Type
-
external:validateParams.ValidationError
Returns:
- always returns the current value for a given metadata name,
which could be
undefined
.
Frequest() → {FetchRequest}
A read-only accessor for the request this response is related to.
Returns:
- Type:
-
FetchRequest