An In-Class @Scope Decorator #17307
Labels
pending-approval
Bug reports that have not been verified yet, or feature requests that have not been accepted yet
type: feature
For issues and PRs. For new features. Never breaking changes.
Issue Creation Checklist
Feature Description
Describe the feature you'd like to see implemented
I'd like to have an in-class @scope decorator like the wonderful @Attribute decorator, because that's such a nice declarative, inline pattern.
I'd like to see something like this
This a of a style thing rather than a new feature, since the feature already exists in a couple different ways. Given the short example its not really obvious why I wouldn't want scopes at the top of the class definition.
Say I have this model (with a bunch more scopes expected in the near future)
If I add a bunch more scopes, they don't cover up the main content, i.e. attribute defintions.
The implementation could look something like this:
Describe why you would like this feature to be added to Sequelize
It seems like a nature extension of the "@Attribute" decorator pattern.
Is this feature dialect-specific?
Would you be willing to resolve this issue by submitting a Pull Request?
Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: