title: How can I prevent calling the API multiple times?
body: <p>I have the following function</p>
  
  <pre><code>$(window).localDatabase('schooldata', schoolId)
  </code></pre>
  
  <p>which either returns a stored value or, if outdated, calls the following</p>
  
  <pre><code>return new Promise(function(resolve, reject){
      console.log('Downloading school database');
      axios.get('/api/school-database/'+schoolId+'/schooldata')
          .then(response =&gt; {
              $(window).storage(
                  'planner',
                  'save',
                  'schooldata-'+schoolId,
                  [response.data]
              ).then(function(response2){
                  resolve(response.data);
                  saveLastUpdate('schooldata-'+schoolId).then(function(response2){
                  triggerOnVueBus('db-updated:schooldata');
              });
          });
      });
  });
  </code></pre>
  
  <p>The code works flawlessly, except I have many Vue components that require the database and on startup call multiple times the Promise i pasted.</p>
  
  <p>I would like to implement a method which does not make another request if one is pending already: what logic should I follow?</p>