Skip to content

Commit

Permalink
Adds a comment explaining why we are forcing materialization of the R…
Browse files Browse the repository at this point in the history
…ecordArray returned by store.query
  • Loading branch information
runspired committed Dec 6, 2016
1 parent b52e4c1 commit 7bf3805
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/dummy/app/routes/query/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default Route.extend({
let token = heimdall.start('ember-data');
return this.get('store').query(modelName, params)
.then((records) => {
// RecordArray lazily materializes the records
// We call toArray() to force materialization for benchmarking
// otherwise we would need to consume the RecordArray in our UI
// and clutter our benchmarks and make it harder to time.
records.toArray();
heimdall.stop(token);
window.result = heimdall.toString();
Expand Down

0 comments on commit 7bf3805

Please sign in to comment.