-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Apaq/add-observable-repo
Added ObservableCrudRepository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
/** | ||
* Interface for events emitted by ObservableCrudRepository. | ||
*/ | ||
export interface CrudRepositoryEvent { | ||
/** | ||
* The type of the event. | ||
*/ | ||
type: 'Created' | 'Updated' | 'Deleted'; | ||
|
||
/** | ||
* The id of the entity changed in the repository. | ||
*/ | ||
id: string; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Observable } from "rxjs"; | ||
import { CrudRepository } from "./crud-repository"; | ||
import { CrudRepositoryEvent } from "./crud-repository-event"; | ||
|
||
/** | ||
* Interface for Oberservable CrudRepositories. Adds changes observable upon the CrudRepository interface. | ||
*/ | ||
export interface ObservableCrudRepository<TYPE, IDTYPE> extends CrudRepository<TYPE, IDTYPE> { | ||
|
||
changes: Observable<CrudRepositoryEvent>; | ||
|
||
} |