Skip to main content

Decorators (core)

@Handle

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

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

@Handler

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

@Subscribe

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

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

Supporting Types

HandlerOptions

interface HandlerOptions {
namespace: string;
Contents?: ContentClass[];
}