Skip to content

Commit

Permalink
no need to unloadRecord after destroyRecord in perf test
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed May 5, 2021
1 parent 23232ec commit 2bfded0
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Route from '@ember/routing/route';
import { run } from '@ember/runloop';

import { all } from 'rsvp';

Expand All @@ -15,9 +14,9 @@ export default Route.extend({
parent
.get('children')
.toArray()
.map((child) => child.destroyRecord().then(() => run(() => child.unloadRecord())))
.map((child) => child.destroyRecord())
);
const parentPromise = parent.destroyRecord().then(() => run(() => parent.unloadRecord()));
const parentPromise = parent.destroyRecord();

return all([childrenPromise, parentPromise]).then(() => {
performance.mark('end-destroy-records');
Expand Down

0 comments on commit 2bfded0

Please sign in to comment.