Skip to content

Commit

Permalink
Using Async await (#71)
Browse files Browse the repository at this point in the history
* Moving promises to asyc/await

* Cleaning up file

* Edit examples

* fix up

* Updating

* Updating comment

* cleanup

Co-authored-by: Sean Thomas Burke <[email protected]>
  • Loading branch information
seantomburke and seantomburke authored Nov 30, 2020
1 parent 7efb2b2 commit d51d9b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/assets/sitemapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default class Sitemapper {
// initialize the timeout method based on the URL, and pass the request object.
this.initializeTimeout(url, requester);

//
// get the response from the requester promise
const response = await requester;

// if the response does not have a successful status code then clear the timeout for this url.
Expand Down Expand Up @@ -260,8 +260,8 @@ export default class Sitemapper {
try {
const response = await this.fetch(url);
sites = response.sites;
} catch (e) {
err = e;
} catch (error) {
err = error;
}
return callback(err, sites);
}
Expand Down

0 comments on commit d51d9b1

Please sign in to comment.