Skip to content

Conversation

mbest
Copy link
Contributor

@mbest mbest commented Aug 28, 2025

This fixes #4573

The issue is that since TypeScript 5.9, a particular pattern for calling observable.map caused a compiler error. Comparing with the definition of new Map, I saw that we could fix this by using function overloads instead of the union type.

Before
image

After
image

Copy link

changeset-bot bot commented Aug 28, 2025

⚠️ No Changeset found

Latest commit: 8b02f14

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mweststrate
Copy link
Member

Thanks for putting this PR and others up! I'll try to review later this or next week, as I've been out of the loop for a bit, I'll need some time to catch up

Copy link
Member

@mweststrate mweststrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@mweststrate mweststrate merged commit 74f26b5 into mobxjs:main Sep 26, 2025
1 check passed
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.

observable.map constructor type error in TS 5.9
2 participants