Home / Function/ getVersionTags() — react Function Reference

getVersionTags() — react Function Reference

Architecture documentation for the getVersionTags() function in tags.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  777968f2_07ba_1603_4de2_6b8d19c2bf69["getVersionTags()"]
  7d63591d_64d7_3647_f176_d8bc764bfb02["tags.js"]
  777968f2_07ba_1603_4de2_6b8d19c2bf69 -->|defined in| 7d63591d_64d7_3647_f176_d8bc764bfb02
  3b3be1d7_edc4_a37b_c737_6aadf82539c8["componentWillMount()"]
  3b3be1d7_edc4_a37b_c737_6aadf82539c8 -->|calls| 777968f2_07ba_1603_4de2_6b8d19c2bf69
  style 777968f2_07ba_1603_4de2_6b8d19c2bf69 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fixtures/dom/src/tags.js lines 45–72

export default function getVersionTags() {
  return new Promise(resolve => {
    let cachedTags;
    if (canUseSessionStorage) {
      cachedTags = sessionStorage.getItem(TAGS_CACHE_KEY);
    }
    if (cachedTags) {
      cachedTags = JSON.parse(cachedTags);
      resolve(cachedTags);
    } else {
      fetch('https://api.github.com/repos/facebook/react/tags?per_page=1000', {
        mode: 'cors',
      })
        .then(res => res.json())
        .then(tags => {
          // A message property indicates an error was sent from the API
          if (tags.message) {
            return resolve(fallbackTags);
          }
          if (canUseSessionStorage) {
            sessionStorage.setItem(TAGS_CACHE_KEY, JSON.stringify(tags));
          }
          resolve(tags);
        })
        .catch(() => resolve(fallbackTags));
    }
  });
}

Domain

Subdomains

Frequently Asked Questions

What does getVersionTags() do?
getVersionTags() is a function in the react codebase, defined in fixtures/dom/src/tags.js.
Where is getVersionTags() defined?
getVersionTags() is defined in fixtures/dom/src/tags.js at line 45.
What calls getVersionTags()?
getVersionTags() is called by 1 function(s): componentWillMount.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free