diff options
Diffstat (limited to 'src/content/operators/impls/ScrollToHomeOperator.ts')
-rw-r--r-- | src/content/operators/impls/ScrollToHomeOperator.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/content/operators/impls/ScrollToHomeOperator.ts b/src/content/operators/impls/ScrollToHomeOperator.ts new file mode 100644 index 0000000..a0d7701 --- /dev/null +++ b/src/content/operators/impls/ScrollToHomeOperator.ts @@ -0,0 +1,20 @@ +import AbstractScrollOperator from "./AbstractScrollOperator"; +import Operator from "../Operator"; +import ScrollPresenter from "../../presenters/ScrollPresenter"; +import SettingRepository from "../../repositories/SettingRepository"; + +export default class ScrollToHomeOperator + extends AbstractScrollOperator + implements Operator { + constructor( + private readonly presenter: ScrollPresenter, + settingRepository: SettingRepository + ) { + super(settingRepository); + } + + async run(): Promise<void> { + const smooth = this.getSmoothScroll(); + this.presenter.scrollToHome(smooth); + } +} |