> My proposal is that we add a way of removing a particular callback, or all
> callbacks, from a Promise. This is different to cancelling a Promise and
> would instead happen if you want the operation to continue but are no
> longer interested in running a function when the Promise is resolved or
>
On Mon, Apr 23, 2018 at 10:56 AM, Oliver Dunk wrote:
> My proposal is that we add a way of removing a particular callback, or all
> callbacks, from a Promise. This is different to cancelling a Promise and
> would instead happen if you want the operation to continue but are no longer
> intereste
> What happens to `p2` if I "unthen" `f` from `p1`?
That’s an interesting point to explore. I would intuitively say p2 continues to
exist, but is never resolved or rejected.
> Interesting. I have a proof of concept that would let you do this
Andrea, that’s pretty much exactly what I was thinkin
If I have `p1` and `p2 = p1.then(f)` - if I "unthen" `f` from `p2` then
it's relatively clear that it simply won't be called.
What happens to `p2` if I "unthen" `f` from `p1`?
On Mon, Apr 23, 2018 at 11:37 AM, Andrea Giammarchi <
andrea.giammar...@gmail.com> wrote:
> Interesting. I have a proof
Interesting. I have a proof of concept that would let you do this:
```js
new Promise(res => setTimeout(res, 1000, 'OK'))
.addListeners(console.log, console.error);
```
and you could drop that listener at any time via the following test:
```js
new Promise(res => setTimeout(res, 1000, 'OK'))
.a
My proposal is that we add a way of removing a particular callback, or all
callbacks, from a Promise. This is different to cancelling a Promise and would
instead happen if you want the operation to continue but are no longer
interested in running a function when the Promise is resolved or reject
6 matches
Mail list logo