Skip to content

Instantly share code, notes, and snippets.

@oops-wrong
Created April 26, 2018 07:09
Show Gist options
  • Save oops-wrong/d8da9b4623b283d1644bc8f233c853bb to your computer and use it in GitHub Desktop.
Save oops-wrong/d8da9b4623b283d1644bc8f233c853bb to your computer and use it in GitHub Desktop.
ngrx
import { Sort } from '@angular/material';
import { Action } from '@ngrx/store';
import { State } from './table.state';
export enum TableActionTypes {
LoadMoreTableModels = '[Table] Load More Table Models',
ResetTable = '[Table] Reset Table',
SortColumn = '[Table] Sort Column',
UpdateTableModels = '[Table] Update Table Models',
}
export class LoadMoreTableModels implements Action {
public readonly type = TableActionTypes.LoadMoreTableModels;
constructor(public payload: { count: number }) {}
}
export class ResetTable implements Action {
public readonly type = TableActionTypes.ResetTable;
constructor(public payload: Partial<State>) {}
}
export class SortColumn implements Action {
public readonly type = TableActionTypes.SortColumn;
constructor(public payload: Sort) {}
}
export class UpdateTableModels implements Action {
public readonly type = TableActionTypes.UpdateTableModels;
constructor(public payload: { loadedModelsCount: number; models: any[] }) {}
}
export type TableActions = LoadMoreTableModels | ResetTable | SortColumn | UpdateTableModels;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment