tracked-tools / tracked-built-ins

Tracked versions of JavaScript's built-in classes
MIT License
128 stars 25 forks source link

Implement `Array.from` #319

Closed chriskrycho closed 2 years ago

chriskrycho commented 2 years ago

Although this does not have anything to do with auto-tracking per se, for TrackedArray to be a complete substitute for Array, it should be possible to simply replace Array.from with TrackedArray.from and have the expected behavior—rather than needing to do new TrackedArray(Array.from(someIterable)).

SergeAstapov commented 2 years ago

@chriskrycho I maybe missing something, but seem like it's already working as expected see https://github.com/tracked-tools/tracked-built-ins/blob/master/addon/src/-private/array.ts#L77

chriskrycho commented 2 years ago

🤣 you are 100% correct; this was just me completely missing it. Thank you.