briebug / ngrx-auto-entity

NgRx Auto-Entity: Simplifying Reactive State
https://briebug.gitbook.io/ngrx-auto-entity/
Other
66 stars 12 forks source link

Feature: Add support for simplified @Entity decorator basic usage #141

Closed jrista closed 4 years ago

jrista commented 4 years ago

When creating entity model types for consumption by Auto-Entity, the @Entity decorator is required. Currently, that decorator in turn requires an IEntityOptions object to be passed with at least a modelName string property. For many simpler use cases, the model name may be the only property required.

This proposal recommends that the @Entity decorator be enhanced to support simpler usage, by requiring either a string for the model name, or the full IEntityOptions object, be passed in. This would allow simple usage as follows:

@Entity('MyEntity')
export class MyEntity {
    @Key id: number;
}