Make WidgetAPI an EventEmitter + use for terminate + cleanups

Use EventEmitter for emitting events, rename terminate event code,
plus misc cleanups from review.

Signed-off-by: Pauli Virtanen <pav@iki.fi>
This commit is contained in:
Pauli Virtanen 2020-04-22 19:20:28 +03:00
parent 352ea29d17
commit cf4137d4b2
3 changed files with 28 additions and 25 deletions

View file

@ -89,8 +89,6 @@ export default class WidgetMessaging {
/**
* Tells the widget that it should terminate now.
* It is not necessarily called in all instances before the widget is removed,
* and the client may force termination with a timeout.
* @returns {Promise<*>} Resolves when widget has acknowledged the message.
*/
terminate() {