# Is there a property or observable that is triggered on transition change?

**URL:** https://meta.discourse.org/t/is-there-a-property-or-observable-that-is-triggered-on-transition-change/89395
**Category:** Development
**Created:** [June 7, 2018, 8:42pm UTC](https://meta.discourse.org/t/is-there-a-property-or-observable-that-is-triggered-on-transition-change/89395 "2018-06-07T20:42:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![coderberry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/coderberry/32/99652_2.png) [@coderberry](https://meta.discourse.org/u/coderberry)
#### Post date: [June 7, 2018, 8:42pm UTC](https://meta.discourse.org/t/is-there-a-property-or-observable-that-is-triggered-on-transition-change/89395/1 "2018-06-07T20:42:49Z")

</div>

I would like to trigger a function each time a URL is changed. Is there a way to do this within a plugin?

Thanks!

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 7, 2018, 9:28pm UTC](https://meta.discourse.org/t/is-there-a-property-or-observable-that-is-triggered-on-transition-change/89395/2 "2018-06-07T21:28:51Z")

</div>

We have this API:

```plaintext
<script type="text/discourse-plugin" version="0.2">
    api.onPageChange((url, title) => {
       Em.run.next(()=>{
           $('body').addClass('xyz')
       });
    });
</script>

```
