From 36c28a538955c0cd9d94c210372337d7a5c2a01b Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 29 Nov 2020 09:31:45 +0900 Subject: extract independent classes --- src/content/operators/impls/ScrollToEndOperator.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/content/operators/impls/ScrollToEndOperator.ts (limited to 'src/content/operators/impls/ScrollToEndOperator.ts') diff --git a/src/content/operators/impls/ScrollToEndOperator.ts b/src/content/operators/impls/ScrollToEndOperator.ts new file mode 100644 index 0000000..8217e15 --- /dev/null +++ b/src/content/operators/impls/ScrollToEndOperator.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 ScrollToEndOperator + extends AbstractScrollOperator + implements Operator { + constructor( + private readonly presenter: ScrollPresenter, + settingRepository: SettingRepository + ) { + super(settingRepository); + } + + async run(): Promise { + const smooth = this.getSmoothScroll(); + this.presenter.scrollToEnd(smooth); + } +} -- cgit v1.2.3