-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7920 from stopfstedt/replace-resources-with-track…
…ed-async-data replace AsyncProcess Resource with TrackedAsyncData equivalent.
- Loading branch information
Showing
4 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
packages/frontend/app/components/curriculum-inventory/sequence-block-details.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 : []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters