diff options
| author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-11 08:04:01 +0900 | 
|---|---|---|
| committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-11 08:04:01 +0900 | 
| commit | bacf83a32083c5a4c4a45c061288081423bbf18a (patch) | |
| tree | f5a73e2b989428ca3f3466b6e4a4cc744e24f4b7 /src/content/repositories | |
| parent | e76ca380f733b515c31297a285d8bea44e074a1b (diff) | |
Make settings as a clean architecture
Diffstat (limited to 'src/content/repositories')
| -rw-r--r-- | src/content/repositories/SettingRepository.ts | 22 | 
1 files changed, 22 insertions, 0 deletions
| diff --git a/src/content/repositories/SettingRepository.ts b/src/content/repositories/SettingRepository.ts new file mode 100644 index 0000000..ce13c25 --- /dev/null +++ b/src/content/repositories/SettingRepository.ts @@ -0,0 +1,22 @@ +import Settings, { DefaultSetting } from '../../shared/Settings'; + +let current: Settings = DefaultSetting; + +export default interface SettingRepository { +  set(setting: Settings): void; + +  get(): Settings; + +  // eslint-disable-next-line semi +} + +export class SettingRepositoryImpl implements SettingRepository { +  set(setting: Settings): void { +    current = setting; +  } + +  get(): Settings { +    return current; +  } + +} | 
