Export main 2 functions from gh + Use in index

Also reformatted gh
This commit is contained in:
2018-06-12 13:31:50 +05:30
parent 70bc0fe828
commit 5ce8442956
2 changed files with 43 additions and 37 deletions
+4 -1
View File
@@ -358,7 +358,7 @@ async function fetchUserIsNotContributor(
};
}
async function fetchUnusedForkedRepos() {
export async function fetchUnusedForkedRepos() {
const params: Octokit.ReposGetForUserParams = {
username,
};
@@ -514,10 +514,13 @@ async function fetchUnusedForkedRepos() {
return unusedRepoNames;
}
export function runMain() {
fetchUnusedForkedRepos().then(unusedRepoNames => {
// tslint:disable-next-line:no-console
console.log(unusedRepoNames);
});
}
// Next steps
//
+3
View File
@@ -1,4 +1,6 @@
import { Greeter } from './greeter';
// tslint:disable-next-line:ordered-imports
import { fetchUnusedForkedRepos, runMain } from './gh';
export * from './greeter';
// tslint:disable-next-line:only-arrow-functions
@@ -11,6 +13,7 @@ export * from './greeter';
// assign Greeter to global
const myWindow = currentWindow as any;
myWindow.Greeter = Greeter;
myWindow.runMain = runMain;
// we can use Greeter , execute following in console
// var greet = new Greeter('myName');
// greet.greet();