refactor(plugins/home): Implementations depend only on StorageApi
This patch removes the VisitsApiFactory, promotes CoreStorageVisitsApi to the main implementation and LocalStorageVisitsApi starts to rely on WebStorage. Signed-off-by: Renan Mendes Carvalho <aitherios@gmail.com>
This commit is contained in:
committed by
Camila Belo
parent
72f3ea7042
commit
baa8af646c
@@ -280,7 +280,7 @@ import {
|
||||
} from '@backstage/plugin-home';
|
||||
// ...
|
||||
export const apis: AnyApiFactory[] = [
|
||||
// Implementation that relies on the integration with storageApi
|
||||
// Implementation that relies on a provided storageApi
|
||||
createApiFactory({
|
||||
api: visitsApiRef,
|
||||
deps: {
|
||||
@@ -291,13 +291,14 @@ export const apis: AnyApiFactory[] = [
|
||||
CoreStorageVisitsApi.create({ storageApi, identityApi }),
|
||||
}),
|
||||
|
||||
// Or a local data implementation, relies on the browser's window.localStorage
|
||||
// Or a local data implementation, relies on WebStorage implementation of storageApi
|
||||
createApiFactory({
|
||||
api: visitsApiRef,
|
||||
deps: {
|
||||
identityApi: identityApiRef,
|
||||
errorApi: errorApiRef
|
||||
},
|
||||
factory: ({ identityApi }) => LocalStoreVisitsApi.create({ identityApi }),
|
||||
factory: ({ identityApi, errorApi }) => LocalStoreVisitsApi.create({ identityApi, errorApi }),
|
||||
}),
|
||||
// ...
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user