UNPKG

996 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.ActionObserver = void 0;
4/**
5 * An ActionObserver can passively listen to {@link Actor#run} inputs and outputs for all actors on a certain bus.
6 *
7 * ActionObserver should not edit inputs and outputs,
8 * they should be considered immutable.
9 *
10 * @see Actor
11 * @see Bus
12 *
13 * @template I The input type of an actor.
14 * @template O The output type of an actor.
15 */
16class ActionObserver {
17 /**
18 * All enumerable properties from the `args` object are inherited to this observer.
19 *
20 * The observer will NOT automatically subscribe to the given bus when this constructor is called.
21 *
22 * @param {IActionObserverArgs<I extends IAction, O extends IActorOutput>} args Arguments object
23 * @throws When required arguments are missing.
24 */
25 constructor(args) {
26 Object.assign(this, args);
27 }
28}
29exports.ActionObserver = ActionObserver;
30//# sourceMappingURL=ActionObserver.js.map
\No newline at end of file