rbuckton / iterable-query

Query API over JavaScript (ECMAScript) Iterators
https://rbuckton.github.io/iterable-query
Apache License 2.0
69 stars 3 forks source link

Document recommended usage of .toObject() #5

Closed DanielSWolf closed 5 years ago

DanielSWolf commented 5 years ago

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 5 years ago

I've added additional documentation and a minor API update to make this easier.

Fixed in aebf92701cec30e6fdf2016709d6f75b74eaad8d Published as iterable-query@1.0.0-pre.13

DanielSWolf commented 5 years ago

Thanks!