• Method decorator that marks a method as a state entry handler. The decorated method will be called when the state machine enters the specified state.

    Type Parameters

    • TState extends string

    Parameters

    • state: TState

      The state to handle entry for

    Returns MethodDecorator

    A method decorator

    Example

    @kosStateEntry('pouring')
    handlePouringStart(): void {
    this.logger.info('Pour started');
    EventBus.publish(TOPIC_POUR_STARTED, { id: this.id });
    }