feat: allow thunked objects to be spreadable#175
Conversation
Arrays returned in thunks can concatenated with the spread operator while objects cannot. This adds traps for ownKeys and getOwnPropertyDescriptor on ThunkProxy to allow non-iterable objects to be spreadable.
|
Thanks for contributing! Spreadable thunked objects are useful, of course. However, before I merge this branch I have to take a closer look at your |
Preserve property descriptors in objects while still allowing them to be spreadable.
Oh, you're right. In that case, we can reflect the getOwnPropertyDescriptor to preserve descriptors. I've pushed a new commit to 'reflect' this 😅. It will throw a |
ivenmarquardt
left a comment
There was a problem hiding this comment.
Looks good, thanks!
Arrays returned in thunks can concatenated with the spread operator while objects cannot. This adds traps for ownKeys and getOwnPropertyDescriptor on ThunkProxy to allow non-iterable objects to be spreadable.