title: How should I return the inside promise?
body: <p>I am trying get the status of the POST request outside of <code>save_function</code>. I am posting this dummy request to Reddit. 
  <code>save_function()</code> always will get the status POST request.</p>
  
  <p>How should I structure my request?</p>
  
  <pre><code>// how can I use always here?
  save_function().always(reason =&gt; {
    // here I am trying to access the post call here
    console.log(reason);
  })
  
  save_function().then(data =&gt; {
    console.log("done");
  });
  
  function test() {
    return $.getJSON("https://www.reddit.com/r/gifs/.json");
  }
  
  function save_function() {
    let myFirstPromise = new Promise((resolve, reject) =&gt; {
      if (true) {
        test().done(data =&gt; {
          resolve(data);
        })
      } else {
        resolve({
          test: "test"
        });
      }
    });
  
    return myFirstPromise.then((data) =&gt; {
      console.log(data);
      // how do i access this  ajax call like caller_function.always()
      return $.ajax({
          method: "POST",
          url: "https://www.reddit.com/r/gifs/.json", //dummy json call 
          data: {
            "test": data.test
          }
        })
        .done(test =&gt; {
          console.log(test);
        })
        .fail(reason =&gt; {
          console.warn(reason);
        })
    });
  }
  </code></pre>