Skip to content

Priority for already loaded record #329

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

Closed
wants to merge 9 commits into from

Conversation

lifeart
Copy link
Contributor

@lifeart lifeart commented Aug 23, 2017

if we already have loaded recored - do not reload it from server

@@ -1,7 +1,7 @@
import Service from '@ember/service';

export default Service.extend({
showInherited: false,
showInherited: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we wouldn't want to change this behaviour for now

Copy link
Contributor Author

@lifeart lifeart Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lifeart
Copy link
Contributor Author

lifeart commented Oct 31, 2017

emberjs/ember.js#15800

@@ -64,7 +69,7 @@ export default Route.extend(ScrollTracker, {

serialize(model) {
return {
class: model.get('name')
class: get(model, 'name')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Turbo87 class route alteady has import { set, get } from '@ember/object';, why not to use them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because they are much harder to read IMHO and only make sense if model was a POJO and not an Ember.Object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rolled-back

@toddjordan
Copy link
Contributor

I might be off base here, but doesn't ember-data implicitly do caching? findRecord should load existing items in the store if already loaded.

@lifeart
Copy link
Contributor Author

lifeart commented Oct 2, 2018

@toddjordan looks like it's depends on adapter configuration - https://github.com/emberjs/data/blob/master/addon/-legacy-private/system/store.js#L520

@toddjordan
Copy link
Contributor

Verified, additional calls to that json are loaded from disk cache, reducing the need for this update.

@toddjordan toddjordan closed this Mar 28, 2019
Gaurav0 pushed a commit to Gaurav0/ember-api-docs that referenced this pull request Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants