Added redux middleware to save parts of the store in the local storage transparently

This commit is contained in:
Alejandro Celaya
2020-04-26 19:04:17 +02:00
parent bbc47b387e
commit 86bf1515d4
8 changed files with 65 additions and 77 deletions

View File

@@ -1,6 +1,6 @@
import RealTimeUpdates from '../RealTimeUpdates';
import Settings from '../Settings';
import { loadRealTimeUpdates, setRealTimeUpdates } from '../reducers/settings';
import { setRealTimeUpdates } from '../reducers/settings';
import SettingsService from './SettingsService';
const provideServices = (bottle, connect) => {
@@ -14,8 +14,7 @@ const provideServices = (bottle, connect) => {
bottle.service('SettingsService', SettingsService, 'Storage');
// Actions
bottle.serviceFactory('setRealTimeUpdates', setRealTimeUpdates, 'SettingsService', 'loadRealTimeUpdates');
bottle.serviceFactory('loadRealTimeUpdates', loadRealTimeUpdates, 'SettingsService');
bottle.serviceFactory('setRealTimeUpdates', () => setRealTimeUpdates);
};
export default provideServices;