@dknutsen wrote:
I guess maybe my real question is "how is store.query supposed to work?" because I might just be misunderstanding this completely. We use store.query a lot in our app as we need to limit what data is returned from our API endpoints. We also currently use (store.query) polling in some views because we haven't switched to websockets or anything like that yet.
What I expected was that if I call store.query in my route's model hook, and then load more data into the store via my poller (also using store.query) that the view would auto-reload with the new data as it does with peekAll or findAll. Unfortunately it does not.
What I had to do to get the desired behavior was to do a peekAll in the model hook, then manage all my polling in the controller. Unfortunately there are a few more complications with that approach in our app (not to mention this issue where store.query was leaking memory) and even if there weren't, it still seems like an ugly workaround.
I suspect that store.query is intended to work differently than the other store methods and my problem is that I just expect it to work the same, but if it does have a different philosophy of action it doesn't seem to be well documented. Can anyone enlighten me? Why doesn't store.query auto-update a view? Is it a misuse of the query method as intended to use it in a route's model hook? Are there other philosophical differences between a query vs a find/peekAll or find/peekRecord?
Or is store.query supposed to function exactly like the other methods and result in auto-updated views and there's a bug in ED or in my code?
Posts: 1
Participants: 1