Skip to content

Commit

Permalink
feat: support for passing empty initialization parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Oct 26, 2022
1 parent 6fa46c0 commit 71534a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/interface/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface ConfigClientOptions {
}

export interface ConfigHandlerOptions<T = any> {
args: T;
args?: T;
clients?: ConfigClientOptions[];
enableDynamicDataSource?: boolean;
}
Expand Down
4 changes: 2 additions & 2 deletions src/provider/ark-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export class ArkManager extends AsyncProviderFactory {
this.options = options;

return {
useFactory: this.getProvider,
useFactory: this.useFactory,
provide: ArkManager.getToken(),
inject,
};
}

@This
private async getProvider(
private async useFactory(
config: ConfigProvider,
observer?: DynamicDataSourceConfigObserver,
) {
Expand Down
4 changes: 3 additions & 1 deletion src/struct/config-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export class ConfigArgumentHandler<T = any> extends AbstractConfigHandler<T> {
}

public async execute(options: ConfigHandlerOptions<T>) {
this.config.merge(options.args);
if (options.args) {
this.config.merge(options.args);
}

await super.execute(options);
}
Expand Down

0 comments on commit 71534a6

Please sign in to comment.