Skip to main content

@jewel998/state-machine - v0.0.5 / ValidationContext

Class: ValidationContext<TConfig>

Context class for Strategy pattern

Type parameters​

Name
TConfig

Table of contents​

Constructors​

Methods​

Constructors​

constructor​

• new ValidationContext<TConfig>(strategy): ValidationContext<TConfig>

Type parameters​

Name
TConfig

Parameters​

NameType
strategyIValidationStrategy<TConfig>

Returns​

ValidationContext<TConfig>

Defined in​

src/patterns/Strategy.ts:53

Methods​

setStrategy​

▸ setStrategy(strategy): void

Parameters​

NameType
strategyIValidationStrategy<TConfig>

Returns​

void

Defined in​

src/patterns/Strategy.ts:57


validate​

▸ validate(config): ValidationResult

Parameters​

NameType
configTConfig

Returns​

ValidationResult

Defined in​

src/patterns/Strategy.ts:61