Skip to content

Commit 170e639

Browse files
committed
fix function names and use async/await instead of chained promises
1 parent 60beda5 commit 170e639

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

readme.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,16 @@ config.set('project', 'namespace/project');
698698
// create report
699699
let report = new Report(config);
700700
701-
// chain promises to query and process data
702-
report.project()
703-
.then(report.issues, error => {})
704-
.then(report.mergeRequests, error => {})
705-
.then(report.processIssues, error => {})
706-
.then(report.processMergeRequests, error => {});
701+
// query and process data
702+
try {
703+
await report.getProject()
704+
await report.getIssues()
705+
await report.getMergeRequests()
706+
await report.processIssues()
707+
await report.processMergeRequests()
708+
} catch (error) {
709+
console.log(error)
710+
}
707711
708712
// access data on report
709713
report.issues.forEach(issue => {

0 commit comments

Comments
 (0)