User menu ajax request
So I have added a couple of custom components to the user menu that slides out when someone clicks their username at the top of the community. The two new components are simply a 'my notifications' and 'private messages' and look like normal links in the menu. For each of these I use the API to get a number for each and if they exist I add those numbers to the menu item.
The menu updates the notification and private message counters on the standard items at the top of the menu (the bell and envelope icons) BUT what I really want to do is apply that same logic to my custom components so they also get the numbers updated. Currently, they update when the page loads and gets the information from the API.
Is there a way I can update my custom components so that they get the numbers via the ajax request?