-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using more granular interfaces adds to expressiveness of the code. Knowing what needs to mutate the state explicitly helps easier understanding of the code and therefore increases the maintainability.
- Loading branch information
1 parent
a1871a2
commit c3c5b89
Showing
16 changed files
with
58 additions
and
42 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
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
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,10 +1,13 @@ | ||
import { IEventSource } from '@/infrastructure/Events/IEventSource'; | ||
import { IFilterResult } from './IFilterResult'; | ||
|
||
export interface IUserFilter { | ||
export interface IReadOnlyUserFilter { | ||
readonly currentFilter: IFilterResult | undefined; | ||
readonly filtered: IEventSource<IFilterResult>; | ||
readonly filterRemoved: IEventSource<void>; | ||
} | ||
|
||
export interface IUserFilter extends IReadOnlyUserFilter { | ||
setFilter(filter: string): void; | ||
removeFilter(): void; | ||
} |
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,13 +1,18 @@ | ||
import { IUserFilter } from './Filter/IUserFilter'; | ||
import { IUserSelection } from './Selection/IUserSelection'; | ||
import { IReadOnlyUserFilter, IUserFilter } from './Filter/IUserFilter'; | ||
import { IReadOnlyUserSelection, IUserSelection } from './Selection/IUserSelection'; | ||
import { IApplicationCode } from './Code/IApplicationCode'; | ||
import { ICategoryCollection } from '@/domain/ICategoryCollection'; | ||
import { OperatingSystem } from '@/domain/OperatingSystem'; | ||
|
||
export interface ICategoryCollectionState { | ||
export interface IReadOnlyCategoryCollectionState { | ||
readonly code: IApplicationCode; | ||
readonly os: OperatingSystem; | ||
readonly filter: IReadOnlyUserFilter; | ||
readonly selection: IReadOnlyUserSelection; | ||
readonly collection: ICategoryCollection; | ||
} | ||
|
||
export interface ICategoryCollectionState extends IReadOnlyCategoryCollectionState { | ||
readonly filter: IUserFilter; | ||
readonly selection: IUserSelection; | ||
readonly collection: ICategoryCollection; | ||
readonly os: OperatingSystem; | ||
} |
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
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
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
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
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
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