aboutsummaryrefslogtreecommitdiff
path: root/src/content/operators/impls/HorizontalScrollOperator.ts
blob: f813f8544f4f39901e2ef92ec65cd287c84d7992 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import AbstractScrollOperator from "./AbstractScrollOperator";
import Operator from "../Operator";
import ScrollPresenter from "../../presenters/ScrollPresenter";
import SettingRepository from "../../repositories/SettingRepository";

export default class HorizontalScrollOperator
  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.scrollHorizonally(this.count, smooth);
  }
}