store
store copied to clipboard
Custom Action Type name
Versions
* ngxs: 2.0.0-rc.21
* @angular/core: 5.2.9
Proposal
Provide opportunity to declare Action Type in custom string format. Only in case if no custom type is provided, generate it from class name.


I think this already work. What happens if you make the type property static?
@vharadkou It already works that way, just have to put static:
export enum Types {
SEARCH = '[PARK] search',
GROW = '[PARK] grow person'
}
export class GrowPersons {
static type = Types.GROW;
constructor(readonly payload: string) {
}
}
export class SearchPeoples {
static type = Types.SEARCH;
}
Closing as answered
Thanks.