I would need for an app to bind a this parametter to a Promise, and i can't find how to do this ...
Here is exactly what i want to do:
var myPromise = new Promise((resolve, reject) => {
console.log(this);
});
myPromise.then();
I would like "this" to have the value i want. Since i need to define it outside.
Is it possible ?
Note: I want to avoid this solution:
var myPromise = (that) => {
return new Promise((resolve, reject) => {
console.log(that);
})
}
myPromise().then();
Since it makes the code really heavy.