mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-25 02:18:20 +03:00
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
import Bottle from 'bottlejs';
|
|
import { ConnectDecorator } from '../../container/types';
|
|
import { checkDomainHealth, filterDomains, listDomains } from '../reducers/domainsList';
|
|
import { DomainSelector } from '../DomainSelector';
|
|
import { ManageDomains } from '../ManageDomains';
|
|
import { editDomainRedirects } from '../reducers/domainRedirects';
|
|
|
|
const provideServices = (bottle: Bottle, connect: ConnectDecorator) => {
|
|
// Components
|
|
bottle.serviceFactory('DomainSelector', () => DomainSelector);
|
|
bottle.decorator('DomainSelector', connect([ 'domainsList' ], [ 'listDomains' ]));
|
|
|
|
bottle.serviceFactory('ManageDomains', () => ManageDomains);
|
|
bottle.decorator('ManageDomains', connect(
|
|
[ 'domainsList', 'selectedServer' ],
|
|
[ 'listDomains', 'filterDomains', 'editDomainRedirects', 'checkDomainHealth' ],
|
|
));
|
|
|
|
// Actions
|
|
bottle.serviceFactory('listDomains', listDomains, 'buildShlinkApiClient');
|
|
bottle.serviceFactory('filterDomains', () => filterDomains);
|
|
bottle.serviceFactory('editDomainRedirects', editDomainRedirects, 'buildShlinkApiClient');
|
|
bottle.serviceFactory('checkDomainHealth', checkDomainHealth, 'buildShlinkApiClient');
|
|
};
|
|
|
|
export default provideServices;
|