Constructor
new Vra(options)
Instantiate the class.
Parameters:
Name | Type | Description |
---|---|---|
options |
VraOptions |
- Source:
Members
actions
Get the actions for this module.
- Source:
modules
Get child modules for this store.
- Source:
store
Get the entire store for this module, for Vuex.
- Source:
Methods
(static) createModules(modules) → {object}
Sugar for creating lots of modules.
Parameters:
Name | Type | Description |
---|---|---|
modules |
object | Object of module configs. |
- Source:
Returns:
- Namespaced Vuex modules.
- Type
- object
(static) requestAdapter(requestParams) → {Promise.<object>}
Allows you to change the request function to something else (e.g. To add
authorization headers) or to use a different HTTP library entirely. The
function context (`this`) is set to the same of the Vuex action.
Parameters:
Name | Type | Description |
---|---|---|
requestParams |
object | Request params for `axios.request`. |
- Source:
Returns:
- The result of the request.
- Type
- Promise.<object>
child(name, child)
Add a child module to this model.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the child model. |
child |
object | Vra | Vra constructor options or Vra instance. |
- Source:
createCall(name, options)
Create an action for an endpoint.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Name of the action. | |||||||||||||||||||||
options |
object |
Properties
|
- Source:
createModel(fieldsOrData, options) → {object}
Instantiate a model class using the helpers if they exist.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
fieldsOrData |
object | |||||||
options |
object |
Properties
|
- Source:
Returns:
Model.
- Type
- object
getCall(name) → {object|null}
Get a calls options.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the action. |
- Source:
Returns:
- Type
- object | null
getParser(options) → {function}
Get the default parser.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
- Source:
Returns:
- Type
- function
getUrl(fields, path) → {string}
Get the URL using the baseUrl and the supplied fields.
Parameters:
Name | Type | Description |
---|---|---|
fields |
object | |
path |
string |
- Source:
Returns:
Endpoint.
- Type
- string
modifyCall(name, options)
Modify an action for an endpoint.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the action. |
options |
object |
- Source: