2.0.1 • Published 11 months ago

@itsy/abortable v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

@itsy/abortable

use

import { useAbortable } from '@itsy/abortable'

let loading = false
const updater = useAbortable()

updater.setCallbacks({
  async updateCb() {
    loading = true
    return await (await fetch('/foo/bar', { signal: updater.signal })).json()
  },
  catchCb(err) {
    console.error('Failed to update due to', err)
  },
  finallyCb() {
    loading = false
  }
})
2.0.1

11 months ago

1.1.0

3 years ago

2.0.0-next.0

2 years ago

2.0.0-next.1

2 years ago

2.0.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago