Completed
Push — master ( aa59a9...9ba8bc )
by Alejandro
27s queued 10s
created

src/settings/services/provideServices.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 21
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 12
mnd 0
bc 0
fnc 2
dl 0
loc 21
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import RealTimeUpdates from '../RealTimeUpdates';
2
import Settings from '../Settings';
3
import { loadRealTimeUpdates, setRealTimeUpdates } from '../reducers/realTimeUpdates';
4
import SettingsService from './SettingsService';
5
6
const provideServices = (bottle, connect) => {
7
  // Components
8
  bottle.serviceFactory('Settings', Settings, 'RealTimeUpdates');
9
10
  bottle.serviceFactory('RealTimeUpdates', () => RealTimeUpdates);
11
  bottle.decorator('RealTimeUpdates', connect([ 'realTimeUpdates' ], [ 'setRealTimeUpdates' ]));
12
13
  // Services
14
  bottle.service('SettingsService', SettingsService, 'Storage');
15
16
  // Actions
17
  bottle.serviceFactory('setRealTimeUpdates', setRealTimeUpdates, 'SettingsService', 'loadRealTimeUpdates');
18
  bottle.serviceFactory('loadRealTimeUpdates', loadRealTimeUpdates, 'SettingsService');
19
};
20
21
export default provideServices;
22