mswjs / interceptors

Low-level network interception library.
https://npm.im/@mswjs/interceptors
MIT License
537 stars 123 forks source link

fix(Interceptor): wrap the "once" event listener, ditch "untilIdle" Promise #430

Closed kettanaito closed 11 months ago

kettanaito commented 12 months ago

Changes

These are internal changes and have no effect on the public API.

This change drops the internal implementation of AsyncEventEmitter used to await all request listeners from being done. Instead, it introduces a RequestConrtoller that just holds a response Promise to whichever surface calling .respondWith().

The request listener await logic is achieved by:

kettanaito commented 11 months ago

Released: v0.25.2 🎉

This has been released in v0.25.2!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.