Skip to content

Commit

Permalink
fix(ch4): remove duplicated (#356)
Browse files Browse the repository at this point in the history
* fix(ch4): remove duplicated

* chore(dep): update lock
  • Loading branch information
azu authored Jun 26, 2021
1 parent 58e8982 commit 8dde632
Show file tree
Hide file tree
Showing 2 changed files with 2,358 additions and 2,134 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
"use strict";
const timeoutPromise = require("../../lib/timeoutPromise").timeoutPromise;
const TimeoutError = require("../../lib/TimeoutError").TimeoutError;
const delayPromise = require("../../lib/delayPromise").delayPromise;
function timeoutPromise(promise, ms) {
const timeout = delayPromise(ms).then(() => {
return Promise.reject(new TimeoutError("Operation timed out after " + ms + " ms"));
});
return Promise.race([promise, timeout]);
}
const cancelableXHR = require("./delay-race-cancel").cancelableXHR;
const object = cancelableXHR("https://httpbin.org/get");
// main
Expand Down
Loading

0 comments on commit 8dde632

Please sign in to comment.