Created
April 26, 2018 07:29
-
-
Save oops-wrong/6b8b6b379cd2b171d5ad241e9e1b602c to your computer and use it in GitHub Desktop.
ngrx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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