Skip to content

Commit

Permalink
Merge pull request #18 from stouch/main
Browse files Browse the repository at this point in the history
feat: Allow custom inject token for async registration with  property
  • Loading branch information
depyronick authored Oct 17, 2024
2 parents 4efdef2 + 25979ea commit bfbda12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/clickhouse.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface ClickHouseModuleAsyncOptions
) => Promise<ClickHouseModuleOptions> | ClickHouseModuleOptions;
inject?: any[];
extraProviders?: Provider[];
name?: string;
}

@Module({})
Expand Down Expand Up @@ -52,7 +53,7 @@ export class ClickHouseModule {
const providers = [
...this.createAsyncProviders(options),
{
provide: CLICKHOUSE_ASYNC_INSTANCE_TOKEN,
provide: options.name || CLICKHOUSE_ASYNC_INSTANCE_TOKEN,
useFactory: (options: ClickHouseModuleOptions) => {
if (!options) {
options = new ClickHouseModuleOptions();
Expand Down

0 comments on commit bfbda12

Please sign in to comment.