-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c785826
commit 048f388
Showing
3 changed files
with
62 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,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; |
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
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