Skip to main content

Decorators (core)

@Action

For Request/Response (Unary). CLI should enforce that actionName is UNIQUE per context.

import { Action } from '@hexajs-dev/core';
@Action(actionName: string)

@Controller

import { Controller } from '@hexajs-dev/core';
@Controller(options: ControllerOptions)

@On

For Fire-and-Forget (Multicast). Multiple methods can listen to the same eventName.

import { On } from '@hexajs-dev/core';
@On(eventName: string)

Supporting Types

ControllerOptions

interface ControllerOptions {
namespace: string;
}