Is there a way to express this:
imagePFFileFromUrl(exampUrl) // (returns a promise)
.then(function(xxx))
// that syntax gives you the results of the
// imagePFFileFromUrl inside the variable xxx.
// I then use it in another function which
// returns another promise...
{
return saveImageFile(xxx, anotherArgument) // (returns a promise)
})
.then(function(savedPFFile)
more like this ..
imagePFFileFromUrl(exampUrl)
.then(saveImageFile(...the results from imagePFFileFromUrl ...))
.then(function(savedPFFile)
when using promise?
Your .then()'s need to have 1 or 2 call back functions. If there is 1, it takes in the resolved value of the promise. If there are two, the second takes the rejected value of the promise. So, no, you can't do what you are trying to do.
Here's a good example of the pattern, with two arguments, notice at return synchUsers