Skip to content

Commit

Permalink
fix: service uid options
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximvdw committed Oct 26, 2023
1 parent 76d9ab9 commit e6b25eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/service/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export abstract class Service extends AsyncEventEmitter {
*/
model: any;

constructor() {
constructor(options: ServiceOptions = {}) {
super();

this.uid = this.constructor.name;
this.uid = options.uid ?? this.constructor.name;

this.prependOnceListener('ready', () => {
this._ready = true;
Expand Down Expand Up @@ -105,3 +105,7 @@ export abstract class Service extends AsyncEventEmitter {
}
}
}

export interface ServiceOptions {
uid?: string;
}

0 comments on commit e6b25eb

Please sign in to comment.