I am wondering how I can get the loading state for my server action to use in other parts of my application.
I have a business partner select dropdown in my header which is part of my layout which is a client component. The select is not inside a form
In my header I want to call my server action when another businesspartner is selected in the dropdown. The server action that does some api calls and other things to switch businesspartner and at the end I will call revalidateTag to revalidate customer data
Now I want to get the loading state from the server action and user that state in my layout and other places inside my app.
Is there any way to get the loading state form the server action and also use it in other components?