Tags

Just finished a hobby exercise to build a GitHub v-card using React.js. I also use EmojiOne library.

jian-github-vcard

The runnable source code is at http://plnkr.co/wJrQG6.

Please note that I used sync ajax call in function isLoginValid (line 80 to 93 in script.jsx). It guarantees that only a valid GitHub login can be added to v-Cards.

  isLoginValid: function(login) {
    var isValid = false;
    $.ajax({
      type: 'GET',
      url: "https://api.github.com/users/" + login,
      success: function(data) {
        if (typeof data.message === "undefined") {
          isValid = true;
        }
      },
      async: false
    });
    return isValid;
  }

 

I got the idea from Scott Allen’s Angular course and Samer Buna’s React course. Both authors use GitHub API and Plunker.

References:

  1. Scott Allen’s Angular course¬†at PluralSight
  2. Samer Buna’s React course at PluralSight
  3. Documentation at https://github.com/facebook/react
  4. EmojiOne library
Advertisements