store icon indicating copy to clipboard operation
store copied to clipboard

Custom Action Type name

Open vharadkou opened this issue 8 years ago • 4 comments

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.

image

image

vharadkou avatar Mar 26 '18 10:03 vharadkou

I think this already work. What happens if you make the type property static?

deebloo avatar Mar 26 '18 11:03 deebloo

@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;
}

mailok avatar Mar 26 '18 13:03 mailok

Closing as answered

deebloo avatar Mar 26 '18 13:03 deebloo

Thanks.

vharadkou avatar Mar 27 '18 07:03 vharadkou