aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-19 15:36:14 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-19 15:36:14 +0900
commit6d9aaef18c9f48684c8bb99e53c586e9781a69f0 (patch)
treed22caf2f416429620fc6117c3ca8148c0776e010 /src/content/usecases
parentc81b82ee39cc05d06597e7cd024de448894efe43 (diff)
Add NavigationPresenter
Diffstat (limited to 'src/content/usecases')
-rw-r--r--src/content/usecases/FocusUseCase.ts1
-rw-r--r--src/content/usecases/NavigateUseCase.ts25
2 files changed, 18 insertions, 8 deletions
diff --git a/src/content/usecases/FocusUseCase.ts b/src/content/usecases/FocusUseCase.ts
index 615442d..0ad4021 100644
--- a/src/content/usecases/FocusUseCase.ts
+++ b/src/content/usecases/FocusUseCase.ts
@@ -1,5 +1,6 @@
import FocusPresenter, { FocusPresenterImpl }
from '../presenters/FocusPresenter';
+
export default class FocusUseCases {
private presenter: FocusPresenter;
diff --git a/src/content/usecases/NavigateUseCase.ts b/src/content/usecases/NavigateUseCase.ts
index f790212..6f82d3f 100644
--- a/src/content/usecases/NavigateUseCase.ts
+++ b/src/content/usecases/NavigateUseCase.ts
@@ -1,27 +1,36 @@
-import * as navigates from '../navigates';
+import NavigationPresenter, { NavigationPresenterImpl }
+ from '../presenters/NavigationPresenter';
+
+export default class NavigateUseCase {
+ private navigationPresenter: NavigationPresenter;
+
+ constructor({
+ navigationPresenter = new NavigationPresenterImpl(),
+ } = {}) {
+ this.navigationPresenter = navigationPresenter;
+ }
-export default class NavigateClass {
openHistoryPrev(): void {
- navigates.historyPrev(window);
+ this.navigationPresenter.openHistoryPrev();
}
openHistoryNext(): void {
- navigates.historyNext(window);
+ this.navigationPresenter.openHistoryNext();
}
openLinkPrev(): void {
- navigates.linkPrev(window);
+ this.navigationPresenter.openLinkPrev();
}
openLinkNext(): void {
- navigates.linkNext(window);
+ this.navigationPresenter.openLinkNext();
}
openParent(): void {
- navigates.parent(window);
+ this.navigationPresenter.openParent();
}
openRoot(): void {
- navigates.root(window);
+ this.navigationPresenter.openRoot();
}
}