Skip to content

Wire names & feature layout

Omega stays maintainable when wire names (intent and event strings) are stable, centralized, and discoverable. This page is the Angular counterpart of having an explicit “surface area” per feature: you express it with TypeScript constants, folder conventions, and ESLint — not a separate runtime contract API.

src/app/auth/
├── models/           # DTOs, view models
├── services/       # HttpClient, facades — only here (ESLint can enforce)
├── omega/
│   ├── auth.constants.ts   # AuthWire, AuthAgentAction, NAVIGATOR_EVENT
│   ├── auth.flow.ts
│   ├── auth.agent.ts
│   ├── auth.behavior.ts
│   └── auth.session.ts     # optional thin session helper
└── views/
    └── auth-page.component.ts
  • omega/ — orchestration (OmegaFlow), agents, behaviors, wire tables.
  • services/HttpClient and external IO.
  • views/ — components: handleIntent, channel.on(...) for UI-bound feedback.

The example app repeats this pattern for cliente, pedidos, and factura.

Wire tables (*.constants.ts)

Define one object per feature (or per bounded context) for events and intents:

typescript
export const AuthWire = {
  intentLogin: 'auth.login',
  loginRequested: 'auth.login.requested',
  success: 'auth.success',
  failure: 'auth.failure',
  logout: 'auth.logout',
} as const;

Use OmegaIntent.fromName(AuthWire.intentLogin, { payload }) and channel.on(AuthWire.failure) everywhere — avoid duplicating raw 'auth.login' strings so renames are mechanical.

ESLint

The omega-angular plugin can require OmegaIntent.fromName / event helpers instead of raw constructors. See ESLint.

Namespacing events (optional)

When several features share one channel, channel.namespace('orders') tags emissions and filters events so a listener sees global events plus its namespace. Use this when subsystems would otherwise collide on generic names.

See Channel & events.

Where “documentation in code” lives

MechanismWhat it documents
AuthWire / PedidosWireWhich strings exist for intents and events
AuthAgentActionWhich reaction.action values the agent handler understands
OmegaFlow.idWhich id switchTo / activate use
ESLint no-http-client-in-orchestrationHTTP belongs under services/, not omega/

What’s next

Omega Angular — by Yeferson Segura. Documentation for the npm package and this repository.