petrosh / diarissues

Get a diary on Issues.
https://petrosh.github.io/diarissues
0 stars 2 forks source link

Prometti? #9

Open petrosh opened 8 years ago

petrosh commented 8 years ago
var p1 = new Promise(function(resolve, reject) {
  resolve("Success!");
  // or
  // reject ("Error!");
});

p1.then(function(value) {
  console.log(value); // Success!
}, function(reason) {
  console.log(reason); // Error!
});

Example

doSomething()  
.then(doSomethingElse)
.catch(handleError)
.then(doMoreStuff)
.then(doFinalThing)
.catch(handleAnotherError)

Start

Reference

  1. Request: [apiRepo, 'git/refs/heads', 'master'].join('/')
    • master.object.sha

      Loader.js

Repository

  1. Request: apiRepo
    • full_name
    • owner.type
    • permissions && permissions.admin
    • fork
    • created_at
    • parent.owner.login
    • parent.name
    • parent.created_at
    • parent_forks
    • parent.full_name

Player owner (check pulls made)

  1. Request: [apiRepos, parent.full_name, 'pulls'].join('/');
    Data: {"base": "teams"}
    • pullsArray

No Pulls made (check teams ref for both)

  1. Request: [apiRepos, parent.full_name, 'git/refs/heads', 'teams'].join('/')
    • parent.teams.object.sha
  2. Request: [apiRepo, "git/refs/heads", "teams"].join('/')
    • teams.object.sha

Teams updated (check data for both)

  1. Request: [apiRepos, parent.full_name, "git/refs/heads", "data"].join('/')
    • parent.data.object.sha
  2. Request: [apiRepo, "git/refs/heads", "data"].join('/')
    • data.object.sha

Data updated (check parent.master)

  1. Request: [apiRepos, parent.full_name, "git/refs/heads", "master"].join('/')
    • parent.master.object.sha

Master updated (load files: setup, leagues, team)

  1. Request: [apiRepo, 'contents', 'setup.json' + '?ref=' + branch.object.sha
    • content
    • sha
  2. Request: [apiRepo, 'contents', 'leagues.json' + '?ref=' + branch.object.sha
    • content
    • sha
  3. Request: [apiRepo, 'contents', 'teams/' + repoOwner + '.json?ref=' + branch.object.sha
    • content
    • sha

      Load page script

bottabom commented 8 years ago
bottabom commented 8 years ago
petrosh commented 8 years ago
petrosh commented 8 years ago
petrosh commented 8 years ago

Michael style

HTML

<script src="https://npmcdn.com/github-api/dist/GitHub.bundle.min.js"></script>
<script src="script.js"></script>

script.js

function getfit(err, repo) {
    if (!err) {
        for (var i = 0; i < repo.length; i++) {
            var p = document.createElement('p');
            p.innerHTML = repo[i].name;
            document.body.appendChild(p);
        }
    }
}

var gh = new GitHub();
var fnp = gh.getOrganization('fork-n-play');
fnp.getRepos(getfit);

Michael Max-Q

Docs