Skip to content

Instantly share code, notes, and snippets.

@Ciaanh
Created January 5, 2020 16:30
Show Gist options
  • Save Ciaanh/331a6dd9535a8a5ffc5efb7853fa7485 to your computer and use it in GitHub Desktop.
Save Ciaanh/331a6dd9535a8a5ffc5efb7853fa7485 to your computer and use it in GitHub Desktop.
Hosthub-step-3-config-loadDbFile.js
loadDbFile() {
var githubApi = new GithubAPi("ciaanh", "hosthub", "db");
githubApi.get(this.db_name, (err, res) => {
if (res === null || res === undefined || res === "") {
res = {
description: "Config description",
name: "my config",
users: []
};
}
let newState = { ...this.state };
newState.config = {
path: this.db_name,
data: res.content
};
this.setState(newState);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment