The current requests rely on the timeouts defined in the browser or in the OS. When executing requests, I'd like to be able to set custom timeouts to the requests made by superagent:
https://visionmedia.github.io/superagent/#timeouts
request
.get('/big-file?network=slow')
.timeout({
response: 5000, // Wait 5 seconds for the server to start sending,
deadline: 60000, // but allow 1 minute for the file to finish loading.
})
.then(res => {
/* responded in time */
}, err => {
if (err.timeout) { /* timed out! */ } else { /* other error */ }
});
This could be passed as options to the hyperwallet constructor or functions. Alternatively we could inject our own instance of superagent which would also give the ability to use custom plugins for superagent
The current requests rely on the timeouts defined in the browser or in the OS. When executing requests, I'd like to be able to set custom timeouts to the requests made by superagent:
https://visionmedia.github.io/superagent/#timeouts
This could be passed as options to the hyperwallet constructor or functions. Alternatively we could inject our own instance of superagent which would also give the ability to use custom plugins for superagent