Here is my function which returns a promise containing text value of a button
getToggleViewButtonText(){
return this.toggleBasicOrAdvancedView.getText()
}
Now, I wrote one more function which takes other functions as a parameter and resolves the promise and returns its value.
promiseResolve(func){
return func.then(value=>{
return value
});
Problem is when I use this
promiseResolve(this.getToggleViewButtonText())
I get promise back instead of text value of button element.But, if I do console.log(value) in promiseResolve function. I can see the value is there. Can some help where I am going wrong here.