Re: [whatwg/fetch] FetchObserver (for a single fetch) (#607)

jimmywarting left a comment (whatwg/fetch#607)

Could Monitor/CreateMonitor be used?
it's used in a few AI places right now... "A CreateMonitor instance is used via the monitor property of an AI API's create() method"

```js
const proofreader = await Proofreader.create({
  ...otherOptions,
  monitor (monitor) {
    monitor.addEventListener("downloadprogress", e => {
      console.log(`Downloaded ${e.loaded * 100}%`);
    });
  }
});
```

so something similar could be done in fetch?
```js
fetch(url, {
  monitor (monitor) {
    monitor.addEventListener("downloadprogress", fn)
    monitor.addEventListener("uploadprogress", fn)
    monitor.addEventListener("statechange", fn)
  } 
})
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/607#issuecomment-3621290634
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/607/3621290634@github.com>

Received on Saturday, 6 December 2025 22:17:55 UTC