diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-11-29 09:31:45 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-12-09 23:09:34 +0900 |
commit | 36c28a538955c0cd9d94c210372337d7a5c2a01b (patch) | |
tree | be12ff6abed9443cfedcb3ab1564ee8562e33858 /src/content/operators/impls/VerticalScrollOperator.ts | |
parent | 809bdb11f3d213254c098411755631b1264c52f0 (diff) |
extract independent classes
Diffstat (limited to 'src/content/operators/impls/VerticalScrollOperator.ts')
-rw-r--r-- | src/content/operators/impls/VerticalScrollOperator.ts | 21 |
1 files changed, 21 insertions, 0 deletions
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<void> { + const smooth = this.getSmoothScroll(); + this.presenter.scrollVertically(this.count, smooth); + } +} |