Skip to content

Commit

Permalink
refactor(command): don't reset child commands with .reset() method
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed Jun 24, 2020
1 parent 9cdc2d2 commit ba85b2a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/command/lib/base-command.ts
Expand Up @@ -149,9 +149,7 @@ export class BaseCommand<O = any, A extends Array<any> = any> {
* Reset internal command reference to main command.
*/
public reset(): this {
this.cmd = this;
this.getBaseCommands( true ).forEach( cmd => cmd.reset() );
return this;
return this.cmd = this;
}

/**
Expand Down Expand Up @@ -237,7 +235,6 @@ export class BaseCommand<O = any, A extends Array<any> = any> {
*/
public action( fn: IAction<O, A> ): this {
this.cmd.fn = fn;
this.reset();
return this;
}

Expand Down

0 comments on commit ba85b2a

Please sign in to comment.