title: How can I transfer a promise resolve() to another promise
body: <p>Let's say I have a "JsonEditor" module (just for the example) which has 3 functions: get(), setProperty() and save().</p>
  
  <p>Here is the code (the question follows):</p>
  
  <pre><code>var fs   = require('fs')
    , q    = require('q');
  
  var jsonEditorModule = (function() {
      return {
          get: function(jsonPath) {
              // ...
          },
  
          save: function(jsonObject, jsonPath) {
              var qJson = q.defer();
  
              var jsonContent = JSON.stringify(jsonObject, null, 2);
  
              fs.writeFile(jsonPath, jsonContent, function(err) {
                  if(err) {
                      qJson.reject(err);
                  }
                  else {
                      qJson.resolve();
                  }
              });
  
              return qJson.promise;
          },
  
          setProperty: function(prop, value, jsonPath) {
              var self = this;
              var qJson = q.defer();
  
              this.get(jsonPath)
              .then(
                  function(jsonObject) {
                      // Set the property
                      jsonObject[prop] = value;
  
                      // Save the file
                      self.save(jsonObject, jsonPath)
                      .then(
                          function() {
                              qJson.resolve();
                          },
                          function() {
                              qJson.reject();
                          },
                      );
                  }
              );
  
              return qJson.promise;
          },
      };
  })();
  
  module.exports = jsonEditorModule;
  </code></pre>
  
  <p>See the then() right after the save() in the setProperty() function ?</p>
  
  <p>It looks stupid, right ?</p>
  
  <p>Do I need to manually resolve() and reject() my promise ?
  Can't I just transfer the save() behavior to my setProperty() promise ?</p>
  
  <p>Hope the question is clear enough (and not too stupid).</p>
  
  <p>Thanks</p>