diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-19 21:34:08 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-19 21:34:08 +0900 |
commit | cdfd54ed99087dc4a7a3fd13865849ff9ce9e8ba (patch) | |
tree | ca18790151d4e6cf003367f0dd87c27371d2b2c8 /src/background/usecases/SettingUseCase.ts | |
parent | c7803e7c2911f63e43611290b996f526c0f8aaf2 (diff) |
Use TSyringe on background script
Diffstat (limited to 'src/background/usecases/SettingUseCase.ts')
-rw-r--r-- | src/background/usecases/SettingUseCase.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/background/usecases/SettingUseCase.ts b/src/background/usecases/SettingUseCase.ts index aa3b534..fd00f80 100644 --- a/src/background/usecases/SettingUseCase.ts +++ b/src/background/usecases/SettingUseCase.ts @@ -1,17 +1,17 @@ -// eslint-disable-next-line max-len -import PersistentSettingRepository from '../repositories/PersistentSettingRepository'; +import { injectable } from 'tsyringe'; +import PersistentSettingRepository + from '../repositories/PersistentSettingRepository'; import SettingRepository from '../repositories/SettingRepository'; import { DefaultSettingData } from '../../shared/SettingData'; import Settings from '../../shared/Settings'; +@injectable() export default class SettingUseCase { - private persistentSettingRepository: PersistentSettingRepository; - private settingRepository: SettingRepository; - - constructor() { - this.persistentSettingRepository = new PersistentSettingRepository(); - this.settingRepository = new SettingRepository(); + constructor( + private persistentSettingRepository: PersistentSettingRepository, + private settingRepository: SettingRepository, + ) { } get(): Promise<Settings> { |