Skip to content

Commit

Permalink
chore: missing typings
Browse files Browse the repository at this point in the history
  • Loading branch information
kukhariev committed Mar 4, 2019
1 parent f482086 commit 3e3d947
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/uploadx/src/xhrfactory.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export let XHRFactory = (() => {
let stack = Array(1).fill(createXHR());
let stack: XMLHttpRequest[] = Array(1).fill(createXHR());

function createXHR() {
function createXHR(): XMLHttpRequest {
return new XMLHttpRequest();
}

return {
release: xhr => {
release: (xhr: XMLHttpRequest) => {
xhr.onreadystatechange = null;
xhr.onerror = null;
xhr.onload = null;
xhr.upload.onprogress = null;
stack.push(xhr);
},
getInstance() {
getInstance(): XMLHttpRequest {
if (!stack.length) {
return createXHR();
} else {
Expand Down

0 comments on commit 3e3d947

Please sign in to comment.