โ† Back to Index ๐Ÿ” Login

MasterRealy

[ ] Denna sida รคr inte markerad som klar

Relay hub utilizing the asynchronous Pipe() to allow for relaying signals from senders to registered receivers.

Declaration

class MasterRealy

Long Description

Replaces Javascript's default event system.

Signlas

Signals should be conceptual, not procedural. E. g. conceptual: USER_REGISTERED, while procedural is FORM_FIELD_CHANGED.

If needed in the future, procedural ones may perhaps be justified to be included but should be separated from conceptual ones, and the intended use should be clear. However, as long as MasterRealy defines the signals, no procedural signals are possible, as MasterRealy doesn't care about the details and internal workings of senders. Senders and receivers have to agree to communicate at a conceptual level, which purposefully abstracts away their peculiarities and prevents hard coupling.
MasterRealy has reflects conceptual awareness of the systems events as a whole, as it defines all the possible signals that corresponds to all possible events in the system that are relevant for communication between modules.
export const Signals = Object.freeze({
  USER_REGISTERED: 0,
});
window.masterRelay = new MasterRealy("pipe-master", Signals);

Legend

The MasterRelay should have a documented legend of all conceptual signals.

Metadata

UUID 019826a3-2c50-75a8-b94a-eeaf62fffd73
Project Core Frontend
Language js
File Path ./js/masterrelay.js
Scope
Modifiers
Created 2025-07-20 07:02:20
Modified 2025-07-20 08:35:31