Skip to content

Instantly share code, notes, and snippets.

@webmasterdevlin
Created July 3, 2019 20:26
Show Gist options
  • Save webmasterdevlin/7c4f15eb4b78c7debf902f7012ce1787 to your computer and use it in GitHub Desktop.
Save webmasterdevlin/7c4f15eb4b78c7debf902f7012ce1787 to your computer and use it in GitHub Desktop.
NgXS Actions: src/app/heroes/hero.action.ts
import { Hero } from "./hero.model";
export class GetHeroes {
static readonly type = "[Hero] Get";
}
export class GetHeroById {
static readonly type = "[Hero] GetById";
constructor(public id: string) {}
}
export class AddHero {
static readonly type = "[Hero] Add";
constructor(public payload: Hero) {}
}
export class UpdateHero {
static readonly type = "[Hero] Update";
constructor(public payload: Hero) {}
}
export class DeleteHero {
static readonly type = "[Hero] Delete";
constructor(public id: string) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment