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

Typescript 5.6.x compatibility with ObservableSet and Observable Map #3927

Open
ymor opened this issue Sep 16, 2024 · 1 comment
Open

Typescript 5.6.x compatibility with ObservableSet and Observable Map #3927

ymor opened this issue Sep 16, 2024 · 1 comment
Labels

Comments

@ymor
Copy link

ymor commented Sep 16, 2024

Intended outcome:
ObservableMap should implement Map correctly and ObservableSet should implement Set correctly

Actual outcome:

Type 'ObservableMap<unknown, unknown>' is not assignable to type 'Map<unknown, unknown>'.
  The types returned by 'entries()' are incompatible between these types.
    Type 'IterableIterator<IMapEntry<unknown, unknown>>' is missing the following properties from type 'MapIterator<[unknown, unknown]>': map, filter, take, drop, and 9 more.
Type 'ObservableSet<unknown>' is not assignable to type 'Set<unknown>'.
  The types returned by 'entries()' are incompatible between these types.
    Type 'IterableIterator<[unknown, unknown]>' is missing the following properties from type 'SetIterator<[unknown, unknown]>': map, filter, take, drop, and 9 more.

How to reproduce the issue:
https://www.typescriptlang.org/play/?target=99&ts=5.6.2#code/JYWwDg9gTgLgBAbzgeQEYGcCmUBuBDVAG0wFk8wAaFDbfIzAZU3gF84AzKCEOAchAioAHrwDcAKHEBjCADt08AcLJgAXHBUAeAK6yA1rIgB3WVV0HjsgHxwAvHFmYj1LLgLEVACgCUE6XIU4JSEmGHVQnX1DExt7R2c0VzpiUJ8JIA

Seems this might be relevant https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#iterator-helper-methods

No errors in Typescript 5.5.x

Versions
[email protected]

@ymor ymor added the 🐛 bug label Sep 16, 2024
@Weffe
Copy link

Weffe commented Sep 17, 2024

Just ran into this issue too. I think we need to update ObservableMap to match the new structure for .entries() with the new iterator helpers.

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

No branches or pull requests

2 participants