ssbeefeater / axios-request Goto Github PK
View Code? Open in Web Editor NEWAn Axios handler for making requests with polling, lock and cancel support.
License: MIT License
An Axios handler for making requests with polling, lock and cancel support.
License: MIT License
Would be great if this library had typing support with Typescript.
Thought it was a bit much to make a PR for 1 char.
In your documentation is says:
requestInstance.isPending(method = '') // returns true when a request is on the fly
requestInstance.isUpdating(method = 'post') // returns true when a request is on the fly after interval request
equestInstance.isPolling(method = 'get') // returns true when polling is enabled
There is missing an "R" in the last request example.
requestInstance.isPending(method = '') // returns true when a request is on the fly
requestInstance.isUpdating(method = 'post') // returns true when a request is on the fly after interval request
requestInstance.isPolling(method = 'get') // returns true when polling is enabled
:)
When executing the below code, there is no support for Promise.finally
should the poll be broken by return false
. Is this something I'm just doing incorrectly?
LoadResults (callback) {
const rq = new Request("...");
var counter = 0;
return rq.poll(2000).get(response => {
callback(response);
counter++;
if(counter === 5) return false;
});
}
Elsewhere:
InvokeResults () {
return Handler.LoadResults(response => {
ctx.commit("UPDATE_RESULTS", response.data);
}).finally(() => {
this.Loading = false;
});
}
Ultimately, this.Loading
never gets set to false
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.