mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-28 20:56:42 +00:00
24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import Bottle from 'bottlejs';
|
|
import RealTimeUpdates from '../RealTimeUpdates';
|
|
import Settings from '../Settings';
|
|
import { setRealTimeUpdatesInterval, toggleRealTimeUpdates } from '../reducers/settings';
|
|
import { ConnectDecorator } from '../../container/types';
|
|
import { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer';
|
|
|
|
const provideServices = (bottle: Bottle, connect: ConnectDecorator) => {
|
|
// Components
|
|
bottle.serviceFactory('Settings', Settings, 'RealTimeUpdates');
|
|
bottle.decorator('Settings', withoutSelectedServer);
|
|
bottle.decorator('Settings', connect(null, [ 'resetSelectedServer' ]));
|
|
|
|
// Services
|
|
bottle.serviceFactory('RealTimeUpdates', () => RealTimeUpdates);
|
|
bottle.decorator('RealTimeUpdates', connect([ 'settings' ], [ 'setRealTimeUpdatesInterval' ]));
|
|
|
|
// Actions
|
|
bottle.serviceFactory('toggleRealTimeUpdates', () => toggleRealTimeUpdates);
|
|
bottle.serviceFactory('setRealTimeUpdatesInterval', () => setRealTimeUpdatesInterval);
|
|
};
|
|
|
|
export default provideServices;
|