0

As the title says, I would like to get a value returned from within a .then() I have the following code:

function getResponse() {
    return rp(options)
    .then(function (response) {
        var result = [];
        // do manipulation and add data to result
        return result;
    })
}

Is it possible to get the value of result without using:

getAWE().then((result) => {console.log(result)});

I would like to use the value without having to use it within a .then() so I can create multiple functions like the above one and not have long chains of .then()

Keagansed
  • 183
  • 1
  • 1
  • 13

0 Answers0