Skip to content

Commit

Permalink
Failing test demoing issues with ember-concurrency tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue authored and Chris Garrett committed Aug 16, 2019
1 parent 8970e54 commit d71432f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
9 changes: 7 additions & 2 deletions transforms/ember-object/__testfixtures__/-mock-telemetry.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
"type": "EmberObject",
"unobservedProperties": { "unobservedProp": ["prop3", "prop4"] }
},
"injecting-service": {
"computedProperties": ["something", "otherThing"],
"ember-concurrency": {
"computedProperties": ["fetchAlerts"],
"observedProperties": [],
"observerProperties": {},
"offProperties": {},
"overriddenActions": [],
"overriddenProperties": [],
"ownProperties": [],
"type": "Component",
"unobservedProperties": {}
},
"injecting-service": {
"computedProperties": ["something", "otherThing"],
"type": "Service",
"unobservedProperties": {}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Component from '@ember/component';
import { task } from 'ember-concurrency';

export default Component.extend({
fetchAlerts: task(function*() {
let alerts = yield this.store.query('alert', {
filter: { id: this.get('alert.id') }
});
return alerts.sortBy('createdAt').reverse();
}).drop(),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import classic from 'ember-classic-decorator';
import Component from '@ember/component';
import { task } from 'ember-concurrency';

@classic
export default class EmberConcurrency extends Component {
@(task(function*() {
let alerts = yield this.store.query('alert', {
filter: { id: this.get('alert.id') }
});
return alerts.sortBy('createdAt').reverse();
}).drop())
fetchAlerts;
}

0 comments on commit d71432f

Please sign in to comment.