diff options
Diffstat (limited to 'src/content/usecases/ScrollUseCase.ts')
-rw-r--r-- | src/content/usecases/ScrollUseCase.ts | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/content/usecases/ScrollUseCase.ts b/src/content/usecases/ScrollUseCase.ts index 6a1f801..32cbef1 100644 --- a/src/content/usecases/ScrollUseCase.ts +++ b/src/content/usecases/ScrollUseCase.ts @@ -1,19 +1,13 @@ -import ScrollPresenter, { ScrollPresenterImpl } - from '../presenters/ScrollPresenter'; -import SettingRepository, { SettingRepositoryImpl } - from '../repositories/SettingRepository'; +import { injectable, inject } from 'tsyringe'; +import ScrollPresenter from '../presenters/ScrollPresenter'; +import SettingRepository from '../repositories/SettingRepository'; +@injectable() export default class ScrollUseCase { - private presenter: ScrollPresenter; - - private settingRepository: SettingRepository; - - constructor({ - presenter = new ScrollPresenterImpl(), - settingRepository = new SettingRepositoryImpl(), - } = {}) { - this.presenter = presenter; - this.settingRepository = settingRepository; + constructor( + @inject('ScrollPresenter') private presenter: ScrollPresenter, + @inject('SettingRepository') private settingRepository: SettingRepository, + ) { } scrollVertically(count: number): void { |