-
Type: Improvement
-
Resolution: Incomplete
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
THIS ISSUE IS STILL A DRAFT
The idea is that Realm.Collection is supposed to emulate Array, and in order to have fewer surprises, the Array methods are added to Realm.Collection. Prior to v10.5.0, we had two classes, Realm.Results and Realm.List, behaving like Array by inheriting from Realm.Collection. In v10.5.0 we expanded our collection classes with Realm.Set and Realm.Directory.
Today, we rely on the Array prototype chain, and adding the methods from Array to our classes.
Method | Realm.Results | Realm.List | Realm.Set | Realm.Dictionary |
---|---|---|---|---|
[] | ✅ (index) | ✅ (index) | ❌ (unordered) | ✅ (string keys) |
toString | ✅ | ✅ | ✅ | ✅ |
toLocaleString | ✅ | ✅ | ✅ | ✅ |
concat | ✅ | ✅ | ❌ | ❌ |
join | ✅ | ✅ | ❌ | ❌ |
slice | ✅ | ✅ | ❌ | ❌ |
lastIndexOf | ✅ | ✅ | ❌ | ❌ |
every | ✅ | ✅ | ❌ | ❌ |
some | ✅ | ✅ | ❌ | ❌ |
forEach | ✅ | ✅ | ✅ | ❌ |
find | ✅ | ✅ | ❌ | ❌ |
findIndex | ✅ | ✅ | ❌ | ❌ |
map | ✅ | ✅ | ❌ | ❌ |
filter | ✅ | ✅ | ❌ | ❌ |
reduce | ✅ | ✅ | ❌ | ❌ |
reduceRight | ✅ | ✅ | ❌ | ❌ |
entries | ✅ | ✅ | ✅ | ✅ |
keys | ✅ | ✅ | ✅ | ✅ |
values | ✅ | ✅ | ✅ | ✅ |
- is depended on by
-
RJS-1743 Realm.Set doesn't implement .length property
- Backlog