refactor(plugins/home): Keep api-report concise.
This patch remove parameter destructuring to simplify api-report reads. Signed-off-by: Renan Mendes Carvalho <aitherios@gmail.com> Co-authored-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
committed by
Camila Belo
parent
64caa4bf20
commit
bc93253806
@@ -265,11 +265,7 @@ export interface VisitsApi {
|
||||
|
||||
// @public
|
||||
export class VisitsApiFactory implements VisitsApi {
|
||||
protected constructor({
|
||||
limit,
|
||||
retrieveAll,
|
||||
persistAll,
|
||||
}: VisitsApiFactoryOptions);
|
||||
protected constructor(options: VisitsApiFactoryOptions);
|
||||
// (undocumented)
|
||||
protected readonly limit: number;
|
||||
// (undocumented)
|
||||
|
||||
@@ -37,14 +37,10 @@ export class CoreStorageVisitsApi extends VisitsApiFactory {
|
||||
return new CoreStorageVisitsApi(options);
|
||||
}
|
||||
|
||||
private constructor({
|
||||
storageApi,
|
||||
identityApi,
|
||||
limit = 100,
|
||||
}: CoreStorageVisitsApiOptions) {
|
||||
super({ limit });
|
||||
this.storageApi = storageApi;
|
||||
this.identityApi = identityApi;
|
||||
private constructor(options: CoreStorageVisitsApiOptions) {
|
||||
super({ limit: options.limit ?? 100 });
|
||||
this.storageApi = options.storageApi;
|
||||
this.identityApi = options.identityApi;
|
||||
this.retrieveAll = async (): Promise<Array<Visit>> => {
|
||||
let visits: Array<Visit>;
|
||||
const { userEntityRef } = await this.identityApi.getBackstageIdentity();
|
||||
|
||||
@@ -36,12 +36,9 @@ export class LocalStorageVisitsApi extends VisitsApiFactory {
|
||||
return new LocalStorageVisitsApi(options);
|
||||
}
|
||||
|
||||
private constructor({
|
||||
limit = 100,
|
||||
identityApi,
|
||||
}: LocalStorageVisitsApiOptions) {
|
||||
super({ limit });
|
||||
this.identityApi = identityApi;
|
||||
private constructor(options: LocalStorageVisitsApiOptions) {
|
||||
super({ limit: options.limit ?? 100 });
|
||||
this.identityApi = options.identityApi;
|
||||
this.retrieveAll = async (): Promise<Array<Visit>> => {
|
||||
let visits: Array<Visit>;
|
||||
const { userEntityRef } = await this.identityApi.getBackstageIdentity();
|
||||
|
||||
@@ -42,14 +42,10 @@ export class VisitsApiFactory implements VisitsApi {
|
||||
protected retrieveAll: () => Promise<Array<Visit>>;
|
||||
protected persistAll: (visits: Array<Visit>) => Promise<void>;
|
||||
|
||||
protected constructor({
|
||||
limit = 100,
|
||||
retrieveAll,
|
||||
persistAll,
|
||||
}: VisitsApiFactoryOptions) {
|
||||
this.limit = Math.abs(limit);
|
||||
this.retrieveAll = retrieveAll ?? (async () => []);
|
||||
this.persistAll = persistAll ?? (async () => {});
|
||||
protected constructor(options: VisitsApiFactoryOptions) {
|
||||
this.limit = Math.abs(options.limit ?? 100);
|
||||
this.retrieveAll = options.retrieveAll ?? (async () => []);
|
||||
this.persistAll = options.persistAll ?? (async () => {});
|
||||
}
|
||||
|
||||
async list(queryParams?: VisitsApiQueryParams): Promise<Visit[]> {
|
||||
|
||||
Reference in New Issue
Block a user