-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathbooks-page.actions.ts
More file actions
45 lines (34 loc) · 1.08 KB
/
books-page.actions.ts
File metadata and controls
45 lines (34 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Book } from "src/app/shared/models/book.model";
import { Action } from "@ngrx/store";
export enum BooksActionTypes {
SelectBook = "[Books Page] Select Book",
ClearSelectedBook = "[Books Page] Clear Selected Book",
CreateBook = "[Books Page] Create Book",
UpdateBook = "[Books Page] Update Book",
DeleteBook = "[Books Page] Delete Book"
}
export class SelectBook implements Action {
readonly type = BooksActionTypes.SelectBook;
constructor(public bookId: string) {}
}
export class ClearSelectedBook implements Action {
readonly type = BooksActionTypes.ClearSelectedBook;
}
export class CreateBook implements Action {
readonly type = BooksActionTypes.CreateBook;
constructor(public book: Book) {}
}
export class UpdateBook implements Action {
readonly type = BooksActionTypes.UpdateBook;
constructor(public book: Book) {}
}
export class DeleteBook implements Action {
readonly type = BooksActionTypes.DeleteBook;
constructor(public book: Book) {}
}
export type BooksActions =
| SelectBook
| ClearSelectedBook
| CreateBook
| UpdateBook
| DeleteBook;