this
JS-0105654 workItems.forEach(async (workItem) => { await this.updateIssue(config, client, workItem); });
655 }
656
657 updateIssue(config, client, workItem) {658 log.info(`Updating issue for work item (${workItem.id})...`);
659 const octokit = new github.getOctokit(config.github.token);
660 const owner = config.GITHUB_REPOSITORY_OWNER;
105 return labels;
106 }
107
108 getAssignee(config, useDefault) {109 let assignee = null;
110
111 if (!!config.assignee && !!config.ado.mappings && !!config.ado.mappings.handles) {
91 return url.replace("api.github.com/repos/", "github.com/");
92 }
93
94 createLabels(seed, labelsObj) { 95 let labels = seed;
96
97 log.debug("Labels:", labelsObj);
87 return new azdo.WebApi(config.ado.orgUrl, azdo.getPersonalAccessTokenHandler(config.ado.token));
88 }
89
90 cleanUrl(url) { 91 return url.replace("api.github.com/repos/", "github.com/");
92 }
93
83 return config;
84 }
85
86 getConnection(config) { 87 return new azdo.WebApi(config.ado.orgUrl, azdo.getPersonalAccessTokenHandler(config.ado.token));
88 }
89
If a class method does not use this
, it can sometimes be made into a static function. If you do convert the method into a static function, instances of the class that call that particular method have to be converted to a static call as well (MyClass.callStaticMethod())
class Person {
sayHi() {
const greeting = document.createElement("div");
greeting.innerText = "Hello!";
document.appendChild();
}
}
const person = new Person();
person.sayHi();
class Person {
static sayHi() {
const greeting = document.createElement("div");
greeting.innerText = "Hello!";
document.appendChild();
}
}
Person.sayHi();