Make find as a clean architecture
This commit is contained in:
parent
bacf83a320
commit
1ba1660269
15 changed files with 424 additions and 182 deletions
19
src/content/repositories/FindRepository.ts
Normal file
19
src/content/repositories/FindRepository.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
export default interface FindRepository {
|
||||
getLastKeyword(): string | null;
|
||||
|
||||
setLastKeyword(keyword: string): void;
|
||||
|
||||
// eslint-disable-next-line semi
|
||||
}
|
||||
|
||||
let current: string | null = null;
|
||||
|
||||
export class FindRepositoryImpl implements FindRepository {
|
||||
getLastKeyword(): string | null {
|
||||
return current;
|
||||
}
|
||||
|
||||
setLastKeyword(keyword: string): void {
|
||||
current = keyword;
|
||||
}
|
||||
}
|
|
@ -18,5 +18,4 @@ export class SettingRepositoryImpl implements SettingRepository {
|
|||
get(): Settings {
|
||||
return current;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue