# Adding types to the messages published with event aggregator (TypeScript)

**URL:** https://discourse.aurelia.io/t/adding-types-to-the-messages-published-with-event-aggregator-typescript/3055
**Category:** Best Practices
**Created:** [November 8, 2019, 3:07pm UTC](https://discourse.aurelia.io/t/adding-types-to-the-messages-published-with-event-aggregator-typescript/3055 "2019-11-08T15:07:27Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![davismj](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/davismj/32/267_2.png) [@davismj](https://discourse.aurelia.io/u/davismj)
#### Post date: [November 14, 2019, 7:59pm UTC](https://discourse.aurelia.io/t/adding-types-to-the-messages-published-with-event-aggregator-typescript/3055/4 "2019-11-14T19:59:03Z")

</div>

You don’t need the enum. If you pass an object, the constructor will be used as the key. Same result.

---

_[View the full topic](https://discourse.aurelia.io/t/adding-types-to-the-messages-published-with-event-aggregator-typescript/3055)._
