mondora / asteroid

An alternative client for a Meteor backend
MIT License
733 stars 101 forks source link

find & findOne #11

Closed Pagebakers closed 10 years ago

Pagebakers commented 10 years ago

In your todo list demo you're using find and findOne methods on your collections, the latest version doesn't include these. Any reason for this?

pscanf commented 10 years ago

Hello there.

Yes, I later removed those two syntax-sugar methods, leaving the underlying reactiveQuery method.

I was thinking about bringing them back though, as they are very intuitive and nice to use. However I couldn't come up with an implementation which satisfied me. I'd like the find method to return an array with the result of the query which is kept up-to-date as the collection changes, but it's not easy since in JS it's not possible to cleanly subclass native Arrays.

I'm open to suggestions, so if you have an idea feel free to share / request / make a PR.

Pagebakers commented 10 years ago

Alright, I'll let you know if I can come up with something.

Thanks for the work so far! this was just what I was looking for.

pscanf commented 10 years ago

Glad to hear it's useful for somebody. :-)