diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-08 14:44:21 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-08 14:44:21 +0900 |
commit | 58123210ab4cdd4a1f2b4720a0abbd88908baa06 (patch) | |
tree | b841120a6347313e34ba4a5ddbfd599e08aa6f16 /src/actions/setting.js | |
parent | 541449b1fced9eea15f415b023206b10724f5315 (diff) |
separate settings
Diffstat (limited to 'src/actions/setting.js')
-rw-r--r-- | src/actions/setting.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/actions/setting.js b/src/actions/setting.js deleted file mode 100644 index c241428..0000000 --- a/src/actions/setting.js +++ /dev/null @@ -1,31 +0,0 @@ -import actions from 'actions'; -import messages from 'shared/messages'; -import DefaultSettings from 'shared/default-settings'; - -const load = () => { - return browser.storage.local.get('settings').then((value) => { - if (value.settings) { - return set(value.settings); - } - return set(DefaultSettings); - }, console.error); -}; - -const save = (settings) => { - return browser.storage.local.set({ - settings - }).then(() => { - return browser.runtime.sendMessage({ - type: messages.SETTINGS_RELOAD - }); - }); -}; - -const set = (settings) => { - return { - type: actions.SETTING_SET_SETTINGS, - settings, - }; -}; - -export { load, save, set }; |