Document recommended usage of .toObject()
Closed this issue · 2 comments
DanielSWolf commented
Query.toObject()
expects as first argument the prototype for the newly-created object. I'm pretty proficient in JavaScript, but prototypes have never become second nature to me.
Usually, what I want is just a plain object, as if I had created it via { ... }
. It would be great if the documentation gave an example of this most likely case. That way, I wouldn't have to wonder each time: Do I pass Object
? Object.prototype
? {}
? null
? (No, probably not null
.)
rbuckton commented
I've added additional documentation and a minor API update to make this easier.
Fixed in aebf927
Published as iterable-query@1.0.0-pre.13
DanielSWolf commented
Thanks!