You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the record was already in the store, the promise will be resolved immediately.
Otherwise, the store will ask the adapter's find method to find the necessary data.
This and other documentation sections led me to believe that fetching a cached record from the store also means not fetching a new version from the server. Thus, I was wondering when I saw fetch requests for cached records in the Chrome developer console. I needed to look into the DS.Store source code to find out that Ember Data can reload a record in the background while returning the currently known version, and that JSONAPIAdapter does this by default.
The existence of background reload should really be easier to discover, ideally by adding a reference to it to both the API documentation of DS.Store and one of the Ember Data guides.
The text was updated successfully, but these errors were encountered:
denisw
changed the title
[docs] Background reload not properly documented
[docs] Background reload not really documented
Feb 12, 2016
I also found this behavior confusing until I read about it in the Ember Data release notes. Unfortunately I find myself digging through the Ember blog really often for implementation details when the docs should be the single source of truth.
I am closing this issue since the documentation should have improved now that #4338 has been merged. Please feel free to reopen if you think this is still not documented sufficiently. Thanks!
The documentation of
DS.Store.findRecord
says:This and other documentation sections led me to believe that fetching a cached record from the store also means not fetching a new version from the server. Thus, I was wondering when I saw fetch requests for cached records in the Chrome developer console. I needed to look into the
DS.Store
source code to find out that Ember Data can reload a record in the background while returning the currently known version, and thatJSONAPIAdapter
does this by default.The existence of background reload should really be easier to discover, ideally by adding a reference to it to both the API documentation of
DS.Store
and one of the Ember Data guides.The text was updated successfully, but these errors were encountered: