# Triggering a function whenever the category is changed within the composer

**URL:** <https://meta.discourse.org/t/triggering-a-function-whenever-the-category-is-changed-within-the-composer/388497>\
**Category:** Development\
**Created:** [November 14, 2025, 3:49pm UTC](https://meta.discourse.org/t/triggering-a-function-whenever-the-category-is-changed-within-the-composer/388497 "2025-11-14T15:49:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![frye\_bradley](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@frye\_bradley](https://meta.discourse.org/u/frye_bradley)\
**Post date:** [November 14, 2025, 3:49pm UTC](https://meta.discourse.org/t/triggering-a-function-whenever-the-category-is-changed-within-the-composer/388497/1 "2025-11-14T15:49:12Z")

</div>

I may be missing something obvious here so I apologize in advance if that’s the case.

My plugin has a custom setting for each category, which is used to show/hide a toggle switch in the composer. The toggle switch is set up in a glimmer component, which is called by an initializer to render in the `composer-fields` plugin outlet.

My goal is to have the composer show/hide the toggle switch whenever the category is changed within the composer, depending on the value of the custom setting tied to that category.

Is it possible to add an observer on the `outletArgs` of a plugin outlet? The composer model is set in the `outletArgs`, so my thinking was to set the observer on the `categoryId` through that. Then I would run a function to check the value of the custom setting in the category. But I’m having trouble with setting up the observer. It could be that I’m setting it up incorrectly, I’m somewhat new to EmberJS.

Or is there a different way to accomplish this?

For context, I am running on Discourse v3.4.7 currently.

Thanks in advance!

---

_[View the full topic](https://meta.discourse.org/t/triggering-a-function-whenever-the-category-is-changed-within-the-composer/388497)._
