From 89c28d67fd7b961833b557da904bd17aa28660c5 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 22 Jul 2018 00:01:24 +0900 Subject: Settings as clean architecture --- src/background/controllers/setting.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/background/controllers/setting.js (limited to 'src/background/controllers') diff --git a/src/background/controllers/setting.js b/src/background/controllers/setting.js new file mode 100644 index 0000000..9e6019e --- /dev/null +++ b/src/background/controllers/setting.js @@ -0,0 +1,18 @@ +import SettingInteractor from '../usecases/setting'; +import ContentMessageClient from '../infrastructures/content-message-client'; + +export default class SettingController { + constructor() { + this.settingInteractor = new SettingInteractor(); + this.contentMessageClient = new ContentMessageClient(); + } + + getSetting() { + return this.settingInteractor.get(); + } + + async reload() { + await this.settingInteractor.reload(); + this.contentMessageClient.broadcastSettingsChanged(); + } +} -- cgit v1.2.3