-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I'm submitting a...
[X] Feature request
Expected behavior
I thought about the feature to attach actions on class level, based on the the concept of a so called provider class. This could be designed as follows:
@State<StateModel>({ name: 'shop', defaults: DEFAULT_SHOP_STATE })
@Injectable()
export class StateClass {
constructor(private someProviderClass:SomeProviderClass) {
attachAction(this,someProviderClass)
}
}
@Injectable()
export class SomeProviderClass {
@Action(SomeAction)
someAction(ctx: StateContext<StateModel>, action: SomeAction) { ... }
}Within the someAction-Method the actions of the SomeProviderClass will be merged to the actions of StateClass.
What is the motivation / use case for changing the behavior?
This could be an alternative, if the user prefers familiar use of the @Action-Decorator. I'm really interested in feedback if it is worth to work on a feature request i would provide.
Thx in advance
PendelinP, meinsiedler, pascalkania and gtteamamxx
Metadata
Metadata
Assignees
Labels
No labels