# Signaler does not work

**URL:** <https://discourse.aurelia.io/t/signaler-does-not-work/3097>\
**Category:** Help Requests\
**Created:** [November 29, 2019, 3:00pm UTC](https://discourse.aurelia.io/t/signaler-does-not-work/3097 "2019-11-29T15:00:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alfhir](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/alfhir/32/1510_2.png) [@Alfhir](https://discourse.aurelia.io/u/Alfhir)\
**Post date:** [November 29, 2019, 3:00pm UTC](https://discourse.aurelia.io/t/signaler-does-not-work/3097/1 "2019-11-29T15:00:21Z")

</div>

Hi!

I have a container that opens and loads data when you click it´s header

page.html

```auto
<page>
<history-list history-entries.to-view="historyEntries" ref="historyContainer"></history-list>
</page>

```

page.js

```auto
 constructor(...) {
    ...
    const updateHistoryEntries = () =>
      this.orderService.fetchOrderHistory(this.order).then(entries => {
        this.historyEntries = entries;
      });
   
    this.containerOpenedListener = e => updateHistoryEntries();
  }

  bind(bindingContext, overrideContext) {
    this.historyContainer.addEventListener('historyContainerOpened', this.containerOpenedListener);
  }

  unbind() {
    this.historyContainer.removeEventListener('historyContainerOpened', 
    this.containerOpenedListener);
  }

```

history-list.html

```auto
<history-list-entry
            repeat.for="entry of historyEntries | sort: sortProperty:sortAscending"
            entry.bind="entry & signal: 'update-history-list-bindings'"
></history-list-entry>

```

It also listens to various events published via event-aggregator. One event triggers

```auto
updateHistoryEntries()

```

(working) and signals the binding to update (not working).

```auto
// shortened
this._eventAggregator.subscribe('event', event => {
  updateHistoryEntries();
  this.signaler.signal('update-history-list-bindings');
});

```

When i close and reopen the container again - triggering ‘historyContainerOpenend’ - the binding updates, but not when i try to signal it.

What could be wrong with this, please?

---

<div class="post-metadata">

**Author:** ![khuongduybui](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/khuongduybui/32/44_2.png) [@khuongduybui](https://discourse.aurelia.io/u/khuongduybui)\
**Post date:** [December 1, 2019, 3:14am UTC](https://discourse.aurelia.io/t/signaler-does-not-work/3097/2 "2019-12-01T03:14:28Z")

</div>

I will try to take a look tomorrow, but in the meantime can you start a sandbox (from [https://codesandbox.io/s/849oxmjm82](https://codesandbox.io/s/849oxmjm82)) with your code? It will be easier to debug.

---

<div class="post-metadata">

**Author:** ![ben-girardet](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ben-girardet/32/333_2.png) [@ben-girardet](https://discourse.aurelia.io/u/ben-girardet)\
**Post date:** [December 2, 2019, 10:26am UTC](https://discourse.aurelia.io/t/signaler-does-not-work/3097/3 "2019-12-02T10:26:11Z")

</div>

I’ve had problems using the signaler until I found out that webpack was referencing several instances of this class (due to sub-dependencies if I understood correctly). I fixed this problem by giving specific aliases to webpack config; which forces webpack to only load one version of the referenced packages:

```auto
module.exports = ({production, server, extractCss, coverage, analyze} = {}) => ({
  resolve: {
    extensions: ['.ts', '.js'],
    modules: [srcDir, 'node_modules'],
    alias: {
      'aurelia-binding': path.resolve(__dirname, 'node_modules/aurelia-binding'),
      'aurelia-store': path.resolve(__dirname, 'node_modules/aurelia-store'),
      'aurelia-templating': path.resolve(__dirname, 'node_modules/aurelia-templating'),
      'aurelia-templating-resources': path.resolve(__dirname, 'node_modules/aurelia-templating-resources'),
      'aurelia-router': path.resolve(__dirname, 'node_modules/aurelia-router'),
      '@aurelia-ux': path.resolve(__dirname, 'node_modules/@aurelia-ux'),
      'bluebird': path.resolve(__dirname, 'node_modules/bluebird')
    }
  },
 ...

```

I can’t tell if this will solve your situation, but I though I would share and see if it can help.

---

<div class="post-metadata">

**Author:** ![Alfhir](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/alfhir/32/1510_2.png) [@Alfhir](https://discourse.aurelia.io/u/Alfhir)\
**Post date:** [December 10, 2019, 9:02am UTC](https://discourse.aurelia.io/t/signaler-does-not-work/3097/4 "2019-12-10T09:02:45Z")

</div>

Sorry, first I had a cold and now i have to put this on hold, because I need to fix something else. 🙄  
As soon as I can get back to resolving this, I´ll share my experiences. Thx for replying guys!

Edit:  
I didn´t (a)wait for the change to happen and called the signaler too early. It´s working fine now.  
-.-

```auto
    const updateHistoryEntries = () =>
      this.orderService.fetchOrderHistory( this.delphiNrForFetchingHistory )
        .then(entries => this.historyEntries = entries)
        .then(this.signaler.signal('update-history-list'));

```

or maybe like this (didn´t try if it´s working):

```auto
this._eventAggregator.subscribe('event', async event => {
  await updateHistoryEntries();
  ...

```
