Forum Academy Marketplace Showcase Pricing Features

Displaying loader when retrieving data from external API


Here is my use case:
I try to display a loader spinner when data is being retrieved from an external API.

Here is my target:

I managed to make it works as by using workflow in order to:

  • Populate and reset group data.
  • Set a group custom state “loading” before and after the API call.

Then, I can toggle the loader/number when the call is in progress/done.

The problem is: I have many graph and API to call on my page and if I use workflow:

  1. It’s painful to maintain (4 actions to add each time)
  2. Call are made sequently and no in parallel so it’s way longer

NB: If I directly put the API call in the group’s data source, data won’t be flush (even with “Reset data” on workflow) between calls so I can’t display my loader.

Thanks a lot for your help !