# AU2 - Why \`ICollectionSubscribable.subscribe()\` returns \`void\`?

**URL:** <https://discourse.aurelia.io/t/au2-why-icollectionsubscribable-subscribe-returns-void/5521>\
**Category:** Uncategorized\
**Created:** [August 13, 2024, 1:44pm UTC](https://discourse.aurelia.io/t/au2-why-icollectionsubscribable-subscribe-returns-void/5521 "2024-08-13T13:44:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nenadvicentic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/nenadvicentic/32/1191_2.png) [@nenadvicentic](https://discourse.aurelia.io/u/nenadvicentic)\
**Post date:** [August 13, 2024, 1:44pm UTC](https://discourse.aurelia.io/t/au2-why-icollectionsubscribable-subscribe-returns-void/5521/1 "2024-08-13T13:44:33Z")

</div>

Hi guys,

I have code like this in Aurelia 2:

```auto
    this._observerLocator.getArrayObserver(this.select1).subscribe({
      handleCollectionChange: () => {
        this._signaler.dispatchSignal("select1-changed");
      }
    });

```

If i want to temporarily unsubscribe and subscribe again (handling navigation back and forward in browser’s history, via `"au:router:location-change"`), I have to put my `ICollectionSubscriber` in a variable:

```auto
  private _subscribe1 = {
    handleCollectionChange: (...params) => {
      this._signaler.dispatchSignal("select1-changed");
    }
  };
// elsewhere...
this._observerLocator.getArrayObserver(this.select1).unsubscribe(this._subscribe1);

```

Is there any reason why something like `ISubscription` is not returned from `.subscribe` method?

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [August 13, 2024, 2:08pm UTC](https://discourse.aurelia.io/t/au2-why-icollectionsubscribable-subscribe-returns-void/5521/2 "2024-08-13T14:08:09Z")

</div>

@nenadvicentic for avoiding doing unnecessary work, the observer won’t create & return any callback or object to the caller. You’ll need to store the information of the observer and subscriber to cancel the subscription later:

```ts
const observer = ....getArrayObserve(...)
const handler = {
  handleCollectionChange: () => { ... }
}
observer.subscribe(handler)
observer.unsubscribe(handler)

```
