vue-async-computed icon indicating copy to clipboard operation
vue-async-computed copied to clipboard

Provide cancel method

Open cxy930123 opened this issue 3 years ago • 0 comments

Can you provide onCancel method as a parameter?

asyncComputed: {
    sum (onCancel) {
      const total = this.x + this.y
      return new Promise(resolve =>
        const timer = setTimeout(() => resolve(total), 1000)
        onCancel(() => clearTimeout(timer))
      )
    }
  }

cxy930123 avatar Dec 06 '21 09:12 cxy930123