Skip to main content


The @destroy decorator is used to mark the destroy method in a block. That method is invoked when the block is destroyed. It receives a props argument with information about the reason why the block is destroyed. It can be used to cleanup things or cancel pending actions.


It can be used to decorate a method in a NodeBlock or HeadlessBlock derived class.

Decorator type

Method ℹ️

Applies to

Decorator signature


Decorated method signature

(props?: {
type: "left" | "canceled";
}): void;

Decorated method parameters

propsobjectYesSpecifies the properties for the destroy method. Contains the following properties:
- type: Specifies the reason for the destroy. Can be left which indicates the runner has left the block and now renders the next block. Or canceled which indicates the runners went backward and renders the previous block.


import { tripetto, destroy, NodeBlock } from "@tripetto/runner";

type: "node",
identifier: "example-block",
class ExampleBlock extends NodeBlock {
destroyMe(props: { type: "left" | "canceled" }): void {
console.log(`This block is ${props.type}!`);