-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
liveQuery fails with a query that has a singular result (like findRecord) #178
Comments
liveQuery
fails with a query that has a singular result (like findRecord
)
|
I think the first option is the right one. I will submit a PR. |
One other option worth considering would be to safelist query ops that return collections and then error if an unrecognized op is passed. And then we wouldn't need to force singular results into arrays. My main concern with changing the shape of the response is that usages like @coleyb's would still return an array to a |
Well, I guess. I think in general, Going back to the issue at hands. I don't really like the idea of relying on inspecting query expression but I guess it follows the principle of less surprise... I am OK with fixing current |
@tchak hehe ... I think you mean
I think this aspect of My concern is properly representing a singular object / null result, and doing so consistently with collection-based results. Probably you're right that the best place to solve this is in orbit itself and to avoid anything ember-specific in the solution (like This is one area where I need to take some time and try out different alternatives.
I don't really like this either, but that was the exact reason I suggested it. Another alternative would be to use ES |
I am more and more convinced that async iterators are the way to go for live query results. They are used for |
@tchak I agree that async iterators have become the standard way to represent live collections. We should consider whether ES |
Attempting to
liveQuery
a single record will failFor example:
The text was updated successfully, but these errors were encountered: