document mixin constructor params

This commit is contained in:
Michael Zhu 2019-10-18 11:45:43 -07:00
parent dfbbe9daa2
commit f014370531
2 changed files with 10 additions and 0 deletions

View File

@ -14,6 +14,11 @@ export function MakerMixin<TBase extends Constructor>(Base: TBase) {
public readonly actor: Actor;
public readonly orderFactory: OrderFactory;
/**
* The mixin pattern requires that this constructor uses `...args: any[]`, but this class
* really expects a single `MakerConfig` parameter (assuming `Actor` is used ) as the base
* class.
*/
constructor(...args: any[]) {
super(...args);
this.actor = (this as any) as Actor;

View File

@ -12,6 +12,11 @@ export function PoolOperatorMixin<TBase extends Constructor>(Base: TBase) {
public readonly poolIds: string[] = [];
public readonly actor: Actor;
/**
* The mixin pattern requires that this constructor uses `...args: any[]`, but this class
* really expects a single `PoolOperatorConfig` parameter (assuming `Actor` is used ) as
* the base class.
*/
constructor(...args: any[]) {
super(...args);
this.actor = (this as any) as Actor;