backend-app-api,backend-plugin-api: refactor existing service factories and fix type issues

Co-authored-by: blam <ben@blam.sh>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-09-09 16:10:59 +02:00
parent fb93ecad9c
commit 2a29d24519
18 changed files with 145 additions and 114 deletions
+4 -6
View File
@@ -31,13 +31,11 @@ export const catalogServiceRef = createServiceRef<CatalogApi>({
createServiceFactory({
service,
deps: {
discoveryFactory: discoveryServiceRef,
discoveryApi: discoveryServiceRef,
},
factory: async ({ discoveryFactory }) => {
const discoveryApi = await discoveryFactory('root');
const catalogClient = new CatalogClient({ discoveryApi });
return async _pluginId => {
return catalogClient;
async factory() {
return async ({ discoveryApi }) => {
return new CatalogClient({ discoveryApi });
};
},
}),