dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

Support `Evented` with symbol types #329

Closed agubler closed 7 years ago

agubler commented 7 years ago

Enhancement

Add support to use a Symbol as an event type.

Package Version: beta1

Code

const myEventType = Symbol();
const evented = new Evented({});

evented.on(myEventType, () => {});
const myEventType = Symbol();
const evented = new Evented({});

evented.emit({ type: myEventType });

Expected behavior:

No errors

Actual behavior:

Errors as Symbols are not supported.