# Selector being called when nothing changed

**URL:** <https://discourse.aurelia.io/t/selector-being-called-when-nothing-changed/4804>\
**Category:** Help Requests\
**Created:** [June 10, 2022, 12:38pm UTC](https://discourse.aurelia.io/t/selector-being-called-when-nothing-changed/4804 "2022-06-10T12:38:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![coder](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@coder](https://discourse.aurelia.io/u/coder)\
**Post date:** [June 10, 2022, 12:38pm UTC](https://discourse.aurelia.io/t/selector-being-called-when-nothing-changed/4804/1 "2022-06-10T12:38:59Z")

</div>

I’m using

```auto
aurelia-framework: 1.3.1
aurelia-store: 1.4.0

```

Using this basic code:

```auto
@connectTo({
	selector: {
		someData: (store) => store.state.pipe(pluck("someData"))
  }
});

...
// inside component
private someDataChanged(newValue: SomeData, oldValue: SomeData) {
  debugger;
}

```

I can inspect the payload `newValue` & `oldValue`. Sometimes these values are not even the `SomeData` type.

It’s like the selector is subscribing to the entire state and every state change. The work around that has been used is guard statements to inspect the contents of `newValue` …

Surely this isn’t intended behaviour for a selector?

---

<div class="post-metadata">

**Author:** ![Alexander-Taran](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/alexander-taran/32/2308_2.png) [@Alexander-Taran](https://discourse.aurelia.io/u/Alexander-Taran)\
**Post date:** [June 11, 2022, 6:26pm UTC](https://discourse.aurelia.io/t/selector-being-called-when-nothing-changed/4804/2 "2022-06-11T18:26:12Z")

</div>

> [@Some questions about aurelia-store](https://discourse.aurelia.io/t/some-questions-about-aurelia-store/3441):
>
> I’ve recently started using aurelia-store to tackle global filters in our application (e.g. when toggling a global tag filter, all resources throughout the app should be filtered on that tag), though I’m running in some issues and would like your advise. Take the following sample component: @connectTo\<State\>({ selector: { foo: store =\> store.state.pipe(pluck("foo")), filters: store =\> store.state.pipe(pluck("filters")) } }) export class MySampleComponent { foo; filters; fi…

Looks like your question was answered before.
