Consolidate all service definitions in one module

This commit is contained in:
Alejandro Celaya
2025-11-15 10:33:42 +01:00
parent 373f0dbbbb
commit 4b655761c6
6 changed files with 50 additions and 79 deletions

View File

@@ -1,18 +0,0 @@
import { FetchHttpClient } from '@shlinkio/shlink-js-sdk/fetch';
import type Bottle from 'bottlejs';
import { withoutSelectedServer } from '../../servers/helpers/withoutSelectedServer';
import { Home } from '../Home';
import { ShlinkWebComponentContainerFactory } from '../ShlinkWebComponentContainer';
export const provideServices = (bottle: Bottle) => {
// Services
bottle.constant('window', window);
bottle.constant('console', console);
bottle.constant('fetch', window.fetch.bind(window));
bottle.service('HttpClient', FetchHttpClient, 'fetch');
bottle.serviceFactory('Home', () => Home);
bottle.decorator('Home', withoutSelectedServer);
bottle.factory('ShlinkWebComponentContainer', ShlinkWebComponentContainerFactory);
};