You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to declare class properties as part of a class definition rather than using @type when initializing them setting them in a constructor. The primary driver for this is declaring properties while using Immutable js.
/**
* Represents an article
* @extends {Immutable.Record}
* @property {string} id - Unique Identifier for Content
* @property {?string} headline - Headline for the article
* @property {?string} body - Article body
*/
class Article extends Record({
id: null,
headline: '',
body: ''
}) {
get lede() { return this.body.split('\n')[0]; }
}
I'm able to get the display how I want with a plugin which seems very hacky:
Short summary of your issue
I would like to be able to declare class properties as part of a class definition rather than using
@type
when initializing them setting them in a constructor. The primary driver for this is declaring properties while using Immutable js.I'm able to get the display how I want with a plugin which seems very hacky:
If you agree with this proposal, I'm happy to take a stab at a PR.
The text was updated successfully, but these errors were encountered: