# V7.8 : On route any common function

**URL:** <https://discuss.elastic.co/t/v7-8-on-route-any-common-function/247871>\
**Category:** Kibana\
**Created:** [September 8, 2020, 10:26am UTC](https://discuss.elastic.co/t/v7-8-on-route-any-common-function/247871 "2020-09-08T10:26:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvvprabhakar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vvvprabhakar/32/53806_2.png) [@vvvprabhakar](https://discuss.elastic.co/u/vvvprabhakar)\
**Post date:** [September 8, 2020, 10:26am UTC](https://discuss.elastic.co/t/v7-8-on-route-any-common-function/247871/1 "2020-09-08T10:26:19Z")

</div>

# v7.8: On route any common function

Is there any common function on every route change?  
For example  
if I am in the home page, if I navigate to the dashboard or visualize page I want to call a function before navigation

Any function ??

---

<div class="post-metadata">

**Author:** ![afharo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/afharo/32/75202_2.png) [@afharo](https://discuss.elastic.co/u/afharo)\
**Post date:** [September 14, 2020, 1:13pm UTC](https://discuss.elastic.co/t/v7-8-on-route-any-common-function/247871/2 "2020-09-14T13:13:00Z")

</div>

Hi @vvvprabhakar,

I think you are after the `core.application.currentAppId$` observable. In your public/plugin.ts file, your start method can look something like:

```auto
public start({ application }: CoreStart) {
  application.currentAppId$.subscribe((appId) => {
    // Callback triggered for every application change
  })
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 12, 2020, 1:13pm UTC](https://discuss.elastic.co/t/v7-8-on-route-any-common-function/247871/3 "2020-10-12T13:13:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
