Closed vinodhrajamuralidharan closed 4 years ago
@vinodhrajamuralidharan Can you provide the error message and a stacktrace, and a snippet of the code for how you're using ember-concurrency within this utility file?
If I write any task inside, I get build error. Though I import at the top, it does not understand the task keyword.
Is there anything I have to do differently?
@vinodhrajamuralidharan It would be hard for me to provide any guidance without some additional context (code, stacktrace, etc.)
I understand. I get this error when I add a concurrency task in the utility file, 'error Parsing error: Unexpected token :' and the code I added is,
Correct me if I am doing anything wrong here in the utility file. I have used in other places and it works great. In the utility, I am trying the very first time.
@vinodhrajamuralidharan looks like insights
is a function, not an ember object or class, so you cannot attach properties to it like that, (or ember-concurrency tasks)
You may be going for something like this?
export const insights = EmberObject.extend({
store: service(),
fetchItems: task(function*(params) {
// ...
})
// ...
});
I just tried in the plain util file. I understand now, ember-concurrency will only work on EmberObject and class. - Thanks
I am trying to use ember-concurrency tasks in my custom ember utility file. But it throws an error.