realm-js
realm-js copied to clipboard
Align `Set` with JavaScript `Set`
Currently, the Set does not perfectly reflect a JS Set. Set currently extends an OrderedCollection, which implements a ReadOnlyArray.
keysshould return values (Setsaren't syntactically index accessible)Setis not ordered, so extendingOrderedCollectionmay lead to assumptions that theSetis ordered.- May be worth looking into
Setimplementing a JSSet, rather than extendingOrderedCollection
Our RealmSet extends the OrderedCollection which implements these for it?
@kraenhansen Good point. I'll have to write some tests as none of this is covered. The implementation of keys does not match a JS Set, which is the same result as values.
I have created test cases for this feature.
@kraenhansen I've refactored the feature request. This would be a breaking change, but probably not high value.