Add NavigationPresenter
This commit is contained in:
parent
c81b82ee39
commit
6d9aaef18c
10 changed files with 314 additions and 105 deletions
|
@ -1,5 +1,6 @@
|
|||
import FocusPresenter, { FocusPresenterImpl }
|
||||
from '../presenters/FocusPresenter';
|
||||
|
||||
export default class FocusUseCases {
|
||||
private presenter: FocusPresenter;
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue