@unbill/ui-utils
v1.9.3
Published
Common UI utilities or components for BDCS projects
Downloads
95
Readme
UI Utils
Common UI functionality used across multiple CardSwap UI projects
Application Documentation
https://confluence.q2ebanking.com/display/BDCS/UI+Utils
Local Development
Environment
import { environment } from '@unbill/ui-utils'
// Gets the current environment production/sandbox/staging/development
environment.getEnvironment(document.location.hostname)
// Gets the API Root of the core API (tentacles)
environment.getCoreApiRoot('development')
Http
// Setup
import { http } from '@unbill/ui-utils'
Vue.Use(http, options)
// Usage
// Options is optional and will use the options passed into the plugin or default options
http.get(url, options)
http.post(url, body, options)
http.delete(url, options)
http.put(url, body, options)
Http Options
// Options and their default values
const options = {
retryHttpStatii: [502, 503, 504],
retryMethods: ['get'], //get, post, put, delete supported
maxRetries: 4,
retryDelay: 500, //milliseconds with backoff for each successive try
backOffStrategy: backOffStrategies.Additive //None, Additive, Exponential
onBefore: [] //Function or array of functions to call before http calls. Don't take parameters.
}
When a response receives an error code, it will automatically throw the response as an error. To prevent this, in your response handling set suppressThrow on the response object itself to a truthy value.
Pre-Commit Hooks
This project is configured to support pre-commit hooks.