1.9.0 • Published 4 months ago
@unbill/ui-utils v1.9.0
ui-utils
Common UI functionality used across multiple BDCS UI projects
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.
1.9.0
4 months ago
1.8.0
5 months ago
1.7.9
1 year ago
1.7.8
2 years ago
1.7.7
2 years ago
1.7.6
2 years ago
1.7.5
3 years ago
1.7.4
4 years ago
1.7.3
4 years ago
1.7.2
4 years ago
1.7.1
4 years ago
1.7.0
4 years ago
1.6.5
4 years ago
1.6.4
4 years ago
1.5.4
4 years ago
1.5.3
4 years ago
1.5.2
4 years ago
1.4.2
4 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.0
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.18
5 years ago
1.0.17
5 years ago
1.0.16
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.6
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago