MartinMalinda / vue-concurrency

A library for encapsulating asynchronous operations and managing concurrency for Vue and Composition API.
https://vue-concurrency.netlify.app/
MIT License
352 stars 15 forks source link

AbortError is called even though task ended with success status #53

Closed JkmAS closed 3 years ago

JkmAS commented 3 years ago

AbortError is called even though the task ended with success status. This happens to me on route change.

Maybe it's related to this issue https://github.com/MartinMalinda/vue-concurrency/issues/13

const task = useTask(function* (signal) {
    const revert = (error?) => {
      console.log('status': task.last?.status); // success
      notifyError();
    };
    signal.pr.catch(revert); // <-- abort('cancel')
    try {
      yield apiTask.perform();
    } catch (e) {
      revert(e);
    }
  }).drop();
MartinMalinda commented 3 years ago

Fixed in 2.1.3 https://github.com/MartinMalinda/vue-concurrency/commit/76af0d55549d1ca39c0dedfd082af3fab007a907