Skip to main content

Action

Callable


  • An @Action is a class decorator to be placed on top of a class that reacts to a change in the node it is declared for. Octo diffs your infrastructure on every run, and invokes the actions whose node changed.

    The interface the action implements is determined by the node it is declared for.

    • An action for a model or an overlay implements IModelAction, and produces resources.
    • An action for a resource implements IResourceAction, and talks to the cloud provider.

    The decorated class is resolved through the Container, so it must have a registered Factory.

    @example
    @Action(MyModel)
    export class AddMyModelAction implements IModelAction<MyModule> { ... }
    @group

    Decorators

    @see

    Definition of Actions.


    Type parameters

    • T: UnknownNode

    Parameters

    • forNode: Constructable<T>

      The class of node for which this action is being declared.

    Returns (constructor: any) => void

    The decorated class.

      • (constructor: any): void
      • Parameters

        • constructor: any

        Returns void