Answer the question
In order to leave comments, you need to log in
Should library parameters be taken out in state?
computed: {
...mapGetters({
userToken: 'User/token',
}),
},
mounted() {
// http://www.resumablejs.com/
const $this = this;
// @todo - should be state?
const resumblejs = this.resumablejs = new Resumable({
target: `${process.env.STORAGE_API_URL}/download/chunk`,
headers: {
'X-AUTH-TOKEN': this.userToken,
},
chunkSize: 1024 * 500, // prevent nginx file size limit 413 error
prioritizeFirstAndLastChunk: true,
simultaneousUploads: 1,
// testChunks: true,
maxFiles: 1,
uploadMethod: 'POST',
retryDelays: [0, 1000, 3000, 5000],
query: {
token: process.env.STORAGE_SECRET,
},
});
Answer the question
In order to leave comments, you need to log in
What's the point of this? Are you going to override these parameters at runtime? In an amicable way, to transfer parameters at initialization. If this is not possible, write a wrapper that will pass default parameters, as well as mix in parameters that can be optionally passed when called.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question