Skip to content

Supporting of new Set methods in observable Sets #3850

@inoyakaigor

Description

@inoyakaigor

Intended outcome:
According to a New Set methods proposal a Set class will have a bunch of new methods (more on MDN). This proposal currently at Stage 3 therefore it means it is becoming part of ECMAScript standart

Current browser's support

Method Firefox (Nigthly) Chrome (> 122) Safari (> 17)
intersection ✔️ ✔️
union ✔️ ✔️
difference ✔️ ✔️
symmetricDifference ✔️ ✔️
isSubsetOf ✔️ ✔️
isSupersetOf ✔️ ✔️
isDisjointFrom ✔️ ✔️

I've created a sandbox with example of code that includes two Sets as store's fields. One of them is observable other one is not.

Actual outcome:
For example if log a store.reactiveSet.intersection we will see an undefined in the console. If log a store.nonReactiveSet.intersection we will see a nonReactiveSet ƒ symmetricDifference() { [native code] } (there I used Chrome 123)
Obviously for other Set's methods result is the same:
image

How to reproduce the issue:

Run code from provided sandbox. Look into browser's console

Versions

Mobx 6.12.1

Also I propose made this as part of Mobx 7 roadmap #3796

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions