Methods
errorHandler(error)
Shows a alert with an error-message.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
error |
any
|
The exception. Could be an instance of HTTPError or any other error/value. |
getSkey() → {Promise.<String>}
Return a new skey.
- Source:
Returns:
- Type:
-
Promise.<String>
The resolved json-Promise (the skey).
request(url, jsonopt, methodopt, paramsopt, customConfigopt) → {Promise.<Response>}
Wrapper for fetch.
Inspired by https://kentcdodds.com/blog/replace-axios-with-a-simple-custom-fetch-wrapper
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
url |
String
|
The url of the ressource to fetch. | |
json |
Object
|
<optional> |
Optional. Data used as json-serialized payload. |
method |
String
|
<optional> |
Optional. The HTTP method, e.g. POST. Default: GET (if json is unset). |
params |
Object
|
<optional> |
Optional. Params used as body for POST and get-query-String for others. |
customConfig |
Object
|
<optional> |
Some custom values for the fetch call. |
Returns:
- Type:
-
Promise.<Response>
Returns the raw request a promise, or throws a HTTPError.