Home Reference Source
import CommandGroup from 'ghastly/src/command/CommandGroup.js'
public class | source

CommandGroup

Extends:

* → CommandGroup

Groups commands.

Constructor Summary

Public Constructor
public

Constructor.

Member Summary

Public Members
public

The name of the group.

Private Members
private

commands: StringMap<CommandObject>

The commands that are a part of the group.

private

middleware: middlewareLayer[]

The middleware applied to the group.

Method Summary

Public Methods
public

Adds a command to the group.

public

applyMiddleware(layers: ...middlewareLayer): CommandGroup

Adds the given middleware to the current group middleware layers.

Public Constructors

public constructor(name: string) source

Constructor.

Params:

NameTypeAttributeDescription
name string

The name of the group.

Public Members

public name: string source

The name of the group.

Private Members

private commands: StringMap<CommandObject> source

The commands that are a part of the group.

private middleware: middlewareLayer[] source

The middleware applied to the group.

Public Methods

public add(command: CommandObject): CommandGroup source

Adds a command to the group.

Params:

NameTypeAttributeDescription
command CommandObject

The command.

Return:

CommandGroup

The instance this method was called on.

public applyMiddleware(layers: ...middlewareLayer): CommandGroup source

Adds the given middleware to the current group middleware layers.

Params:

NameTypeAttributeDescription
layers ...middlewareLayer

The layers to apply.

Return:

CommandGroup

The instance this method was called on.

Emit:

CommandGroup#middlewareUpdate