Deleted SettingsService, as the task is not transparently handled by a redux middleware

This commit is contained in:
Alejandro Celaya
2020-04-26 19:07:47 +02:00
parent 86bf1515d4
commit 7dd6a31609
3 changed files with 0 additions and 64 deletions

View File

@@ -1,14 +0,0 @@
const SETTINGS_STORAGE_KEY = 'settings';
export default class SettingsService {
constructor(storage) {
this.storage = storage;
}
loadSettings = () => this.storage.get(SETTINGS_STORAGE_KEY) || {};
updateSettings = (settingsToUpdate) => this.storage.set(SETTINGS_STORAGE_KEY, {
...this.loadSettings(),
...settingsToUpdate,
})
}

View File

@@ -1,7 +1,6 @@
import RealTimeUpdates from '../RealTimeUpdates';
import Settings from '../Settings';
import { setRealTimeUpdates } from '../reducers/settings';
import SettingsService from './SettingsService';
const provideServices = (bottle, connect) => {
// Components
@@ -10,9 +9,6 @@ const provideServices = (bottle, connect) => {
bottle.serviceFactory('RealTimeUpdates', () => RealTimeUpdates);
bottle.decorator('RealTimeUpdates', connect([ 'settings' ], [ 'setRealTimeUpdates' ]));
// Services
bottle.service('SettingsService', SettingsService, 'Storage');
// Actions
bottle.serviceFactory('setRealTimeUpdates', () => setRealTimeUpdates);
};