Chatto/chatto/src/main/javascript/ts/out/observe/observer.js

28 lines
874 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// /**
// * The Observer interface declares the update method, used by subjects.
// */
// interface Observer {
// // Receive update from subject.
// update(subject: Subject): void;
// }
// /**
// * Concrete Observers react to the updates issued by the Subject they had been
// * attached to.
// */
// class ConcreteObserverA implements Observer {
// public update(subject: Subject): void {
// if (subject.state < 3) {
// console.log('ConcreteObserverA: Reacted to the event.');
// }
// }
// }
// class ConcreteObserverB implements Observer {
// public update(subject: Subject): void {
// if (subject.state === 0 || subject.state >= 2) {
// console.log('ConcreteObserverB: Reacted to the event.');
// }
// }
// }