aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases/FindUseCase.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-05-02 17:25:56 +0900
committerGitHub <noreply@github.com>2020-05-02 17:25:56 +0900
commit5df0537bcf65a341e79852b1b30379c73318529c (patch)
treeaee5efe52412855f620cb514a13a2c14373f27b7 /src/content/usecases/FindUseCase.ts
parent685f2b7b69218b06b5bb676069e35f79c5048c9b (diff)
parent75abd90ecb8201ad845b266f96220d8adfe19b2d (diff)
Merge pull request #749 from ueokande/qa-0.28
QA 0.28
Diffstat (limited to 'src/content/usecases/FindUseCase.ts')
-rw-r--r--src/content/usecases/FindUseCase.ts31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/content/usecases/FindUseCase.ts b/src/content/usecases/FindUseCase.ts
index c6a478f..bff0eee 100644
--- a/src/content/usecases/FindUseCase.ts
+++ b/src/content/usecases/FindUseCase.ts
@@ -1,18 +1,17 @@
-import { injectable, inject } from 'tsyringe';
-import FindPresenter from '../presenters/FindPresenter';
-import FindRepository from '../repositories/FindRepository';
-import FindClient from '../client/FindClient';
-import ConsoleClient from '../client/ConsoleClient';
+import { injectable, inject } from "tsyringe";
+import FindPresenter from "../presenters/FindPresenter";
+import FindRepository from "../repositories/FindRepository";
+import FindClient from "../client/FindClient";
+import ConsoleClient from "../client/ConsoleClient";
@injectable()
export default class FindUseCase {
constructor(
- @inject('FindPresenter') private presenter: FindPresenter,
- @inject('FindRepository') private repository: FindRepository,
- @inject('FindClient') private client: FindClient,
- @inject('ConsoleClient') private consoleClient: ConsoleClient,
- ) {
- }
+ @inject("FindPresenter") private presenter: FindPresenter,
+ @inject("FindRepository") private repository: FindRepository,
+ @inject("FindClient") private client: FindClient,
+ @inject("ConsoleClient") private consoleClient: ConsoleClient
+ ) {}
async startFind(keyword?: string): Promise<void> {
this.presenter.clearSelection();
@@ -36,18 +35,16 @@ export default class FindUseCase {
return this.findNextPrev(true);
}
- private async findNextPrev(
- backwards: boolean,
- ): Promise<void> {
+ private async findNextPrev(backwards: boolean): Promise<void> {
const keyword = await this.getKeyword();
if (!keyword) {
return this.showNoLastKeywordError();
}
const found = this.presenter.find(keyword, backwards);
if (found) {
- this.consoleClient.info('Pattern found: ' + keyword);
+ this.consoleClient.info("Pattern found: " + keyword);
} else {
- this.consoleClient.error('Pattern not found: ' + keyword);
+ this.consoleClient.error("Pattern not found: " + keyword);
}
}
@@ -65,6 +62,6 @@ export default class FindUseCase {
}
private async showNoLastKeywordError(): Promise<void> {
- await this.consoleClient.error('No previous search keywords');
+ await this.consoleClient.error("No previous search keywords");
}
}