I wonder if what I'm doing is in the right way
What I want to do is create a Promise with a customized ".then ()"
ex: myPromise.accepted (value => console.log (value))
what i managed to do
Promise.prototype.accepted = Promise.prototype.then
js code for this
const myPromise = new Promise ((resolve, reject) => {
resolve (true)
})
myPromise.accepted (status => console.log (status))
but I don’t know if it’s the right way to do it