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

    Type Parameters

    • TState extends string

    Parameters

    • state: TState

      The state to handle exit for

    Returns MethodDecorator

    A method decorator

    Example

    @kosStateExit('pouring')
    handlePouringEnd(): void {
    this.logger.info('Pour ended');
    EventBus.publish(TOPIC_POUR_ENDED, { id: this.id });
    }