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 --- .../operators/impls/VerticalScrollOperator.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/content/operators/impls/VerticalScrollOperator.ts (limited to 'src/content/operators/impls/VerticalScrollOperator.ts') diff --git a/src/content/operators/impls/VerticalScrollOperator.ts b/src/content/operators/impls/VerticalScrollOperator.ts new file mode 100644 index 0000000..4ab336c --- /dev/null +++ b/src/content/operators/impls/VerticalScrollOperator.ts @@ -0,0 +1,21 @@ +import AbstractScrollOperator from "./AbstractScrollOperator"; +import Operator from "../Operator"; +import ScrollPresenter from "../../presenters/ScrollPresenter"; +import SettingRepository from "../../repositories/SettingRepository"; + +export default class VerticalScrollOperator + extends AbstractScrollOperator + implements Operator { + constructor( + private readonly presenter: ScrollPresenter, + settingRepository: SettingRepository, + private readonly count: number + ) { + super(settingRepository); + } + + async run(): Promise { + const smooth = this.getSmoothScroll(); + this.presenter.scrollVertically(this.count, smooth); + } +} -- cgit v1.2.3