Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Disposable): make the ".dispose()" method synchronous #2144

Merged
merged 1 commit into from
May 8, 2024

Conversation

kettanaito
Copy link
Member

Fixing an oversight. The .dispose() method of Disposable is not meant to be async. In fact, we aren't using it that way anywhere in MSW. Looks like a leftover from 1.x -> 2.x migration.

To prevent confusion, rewriting that method to do the following:

  1. Be sync.
  2. Actually shift the subscription functions so you cannot fire them multiple times.

@kettanaito kettanaito changed the title fix: make ".dispose()" synchronous fix(Disposable): make the ".dispose()" method synchronous May 8, 2024
@kettanaito kettanaito merged commit 686d3d6 into main May 8, 2024
12 checks passed
@kettanaito kettanaito deleted the fix/disposable-sync branch May 8, 2024 13:49
@kettanaito
Copy link
Member Author

Released: v2.3.0 🎉

This has been released in v2.3.0!

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


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant