Skip to content

Commit

Permalink
replace AsyncProcess with TrackedAsyncData equivalent.
Browse files Browse the repository at this point in the history
  • Loading branch information
stopfstedt committed Jul 3, 2024
1 parent db02ee7 commit 065e50f
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import Component from '@glimmer/component';
import { use } from 'ember-could-get-used-to-this';
import AsyncProcess from 'ilios-common/classes/async-process';
import { cached } from '@glimmer/tracking';
import { TrackedAsyncData } from 'ember-async-data';

export default class CurriculumInventorySequenceBlockDetailsComponent extends Component {
@use allParents = new AsyncProcess(() => [
this.args.sequenceBlock.getAllParents.bind(this.args.sequenceBlock),
]);
@cached
get allParentsData() {
return new TrackedAsyncData(this.args.sequenceBlock.getAllParents(this.args.sequenceBlock));
}

get allParents() {
return this.allParentsData.isResolved ? this.allParentsData.value : [];
}
}

0 comments on commit 065e50f

Please sign in to comment.