yarn add chglog
Define a visitor
export interface Visitor {
visitLabel(label: Label, source: PullRequest): void;
visitAuthor(author: User, source: PullRequest): void;
}
const createSampleVistor = () => {
return {
visitLabel(label: Label, source: PullRequest) {
...
},
visitAuthor(author: User, source: PullRequest) {
...
},
};
Fetch and parse
const visitor = createSampleVistor();
await fetchData(
{
rightRef: '',
leftRef: '',
githubToken: '',
repoOwner: '',
repoName: '',
workingDirectory: ''
},
visitor
);