From afdd6d15792b42b8d3c97a1f4c5c31b154949a68 Mon Sep 17 00:00:00 2001 From: duart38 Date: Thu, 30 Jul 2020 14:07:41 +0200 Subject: [PATCH] Added some JSDoc --- Observe.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Observe.ts b/Observe.ts index 6a044e6..768df10 100644 --- a/Observe.ts +++ b/Observe.ts @@ -16,6 +16,9 @@ export default class Observe { this.history.push(defaultValue); } + /** + * Gets the last added value + */ public getValue(): T { return this.history[this.history.length - 1]; } @@ -69,6 +72,10 @@ export default class Observe { this.setValue(this.getHistory()[0]); } + /** + * Dispatches events to listeners + * @param value The value to dispatch + */ private emit(value: T) { this.currentEvent = new CustomEvent(this.eventID, { detail: value }); const success = dispatchEvent(this.currentEvent);