aboutsummaryrefslogtreecommitdiff
path: root/src/background/controllers/SettingController.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/controllers/SettingController.ts')
-rw-r--r--src/background/controllers/SettingController.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/background/controllers/SettingController.ts b/src/background/controllers/SettingController.ts
new file mode 100644
index 0000000..dfd2817
--- /dev/null
+++ b/src/background/controllers/SettingController.ts
@@ -0,0 +1,23 @@
+import SettingUseCase from '../usecases/SettingUseCase';
+import ContentMessageClient from '../infrastructures/ContentMessageClient';
+import Settings from '../../shared/Settings';
+
+export default class SettingController {
+ private settingUseCase: SettingUseCase;
+
+ private contentMessageClient: ContentMessageClient;
+
+ constructor() {
+ this.settingUseCase = new SettingUseCase();
+ this.contentMessageClient = new ContentMessageClient();
+ }
+
+ getSetting(): Promise<Settings> {
+ return this.settingUseCase.get();
+ }
+
+ async reload(): Promise<any> {
+ await this.settingUseCase.reload();
+ this.contentMessageClient.broadcastSettingsChanged();
+ }
+}