UNPKG

chrono-forge

Version:

A comprehensive framework for building resilient Temporal workflows, advanced state management, and real-time streaming activities in TypeScript. Designed for a seamless developer experience with powerful abstractions, dynamic orchestration, and full cont

15 lines (14 loc) 661 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Signal = void 0; require("reflect-metadata"); const metadata_1 = require("./metadata"); const Signal = (options) => { return (target, propertyKey) => { const signals = Reflect.getOwnMetadata(metadata_1.SIGNAL_METADATA_KEY, target) ?? []; const signalName = typeof options === 'string' ? options : (options?.name ?? propertyKey); signals.push([signalName, propertyKey, options && typeof options === 'object' ? options : undefined]); Reflect.defineMetadata(metadata_1.SIGNAL_METADATA_KEY, signals, target); }; }; exports.Signal = Signal;