Error "@computed can only be used on accessors or fields..." using task decorator with modifiers
See original GitHub issueWriting code like explained in the tutorial “Version 3: Preventing Concurrency (with Tasks)” throws an exception:
Error: Assertion Failed: @computed can only be used on accessors or fields, attempted to use it with seriesAddTask but that was a method. Try converting it to a getter (e.g.
get seriesAddTask() {}
)
My code is:
import { task } from 'ember-concurrency';
....
@task({ drop: true })
*seriesAddTask() {
....
}
I’m using ember-concurrency 2.0.3.
Writing it in this other way works fine:
@(task(function* () {
....
}).drop()) seriesAddTask;
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
How to create a setter for an observable prop #839 - GitHub
I noticed a repeated pattern in my code setup, usually in my store i would have some observables defined as follows: @observable loading: ......
Read more >Python's property(): Add Managed Attributes to Your Classes
In this step-by-step tutorial, you'll learn how to create managed attributes, also known as properties, using Python's property() in your custom classes.
Read more >Native Classes - Octane Upgrade Guide - Ember Guides
Decorators are modifiers that change the behavior of a field, method, or class. Native decorators are functions that get applied using the @...
Read more >Advanced TypeScript 4.8 Concepts: Classes and Types
Gain a deeper understanding of how TypeScript's type system enhances classes via interfaces, access modifiers, decorators and other features ...
Read more >typescript-cheatsheet - GitHub Pages
A set of TypeScript related notes used for quick reference. The cheatsheet contains references to types, classes, decorators, and many other TypeScript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m using npm but you have found the problem!
There’s a way to solve the problem without uninstalling ember-google-maps?
Ok, thank you so much!