Skip to content
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

calling reload multiple times on a has many triggers only one request #4153

Merged
merged 1 commit into from
Feb 17, 2016
Merged

calling reload multiple times on a has many triggers only one request #4153

merged 1 commit into from
Feb 17, 2016

Conversation

sly7-7
Copy link
Contributor

@sly7-7 sly7-7 commented Feb 11, 2016

Closes #2327

cc @igorT @wecc

{ id: 2, body: "Second" }
];
resolve(value);
}, 100);
Copy link
Member

Choose a reason for hiding this comment

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

Lets drop the setTimeout and instead return:

return Ember.RSVP.resolve([
           { id: 1, body: "First" },
           { id: 2, body: "Second" }
       ]);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought there must be a setTimeout in order to be "sure" the multiple reloads where not resolved. But for sure it's better if I can avoid that. Will do this :)

@sly7-7
Copy link
Contributor Author

sly7-7 commented Feb 12, 2016

@bmac Done. So I have to wrap the promises inside a promiseManyArray in order to be able to check the promise state. This seems to work, but I wonder if it's the right way even if I don't think we have an other way now to check the state of Promises

@pangratz
Copy link
Member

LGTM

@bmac
Copy link
Member

bmac commented Feb 16, 2016

LGTM @wecc or @igorT do either of you have the bandwidth for a review?

@wecc
Copy link
Contributor

wecc commented Feb 17, 2016

LGTM 👍

bmac added a commit that referenced this pull request Feb 17, 2016
calling reload multiple times on a has many triggers only one request
@bmac bmac merged commit dc5197e into emberjs:master Feb 17, 2016
@bmac
Copy link
Member

bmac commented Feb 17, 2016

Thanks @sly7-7

@sly7-7 sly7-7 deleted the multiple-reloads-one-request branch February 17, 2016 18:51
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