# Stop from receiving notifications

Whenever we add a hook in the store it always return a `HookLink` instance that represents the link between the hook and the store. We can use it to stop our hook from getting notified on any dispatched action.

In this example we use the `destroy` method to manually destroy the hook when it reach its 3rd invocation.

{% hint style="danger" %}
`hookLink` is only available inside reducers after hook initial phase.
{% endhint %}

{% code title="controller-d.js" %}

```javascript
angular
  .module('App', [])
  .controller('ControllerD', function ControllerD($scope, CounterStore) {
    const hookLink = CounterStore.hook('INCREMENT_COUNT', (state, calls) => {
      $scope.count = state.count;

      if (calls === 3) {
        hookLink.destroy();
      }
    });
  });
```

{% endcode %}

Another method of `HookLink` is `destroyOn`. This method is used for auto destroying of hook. It basically bind the hook to AngularJS scope so when the scope destroyed also hook is get destroyed.

{% code title="controller-d.js" %}

```javascript
angular
  .module('App', [])
  .controller('ControllerD', function ControllerD($scope, CounterStore) {
    CounterStore.hook('INCREMENT_COUNT', (state) => {
      $scope.count = state.count;
    }).destroyOn($scope);
  });
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://angularjs-store.gitbook.io/docs/v3.0.0/tutorials/stop-from-receiving-notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
