swiss-seismological-service / REIA-web

Frontend report generation for results of the near real time event specific loss calculations.
GNU Affero General Public License v3.0
0 stars 1 forks source link

Feature: dispatch event when data is falsy or fetch/update error #37

Closed romanoe closed 6 months ago

romanoe commented 6 months ago

OpenCMS integration Let OpenCMS know if the data is empty or if there's a fetch/update error. This information is needed to display content depending on the availability of data. All the events are dispatched in the updateData() function.

schmidni commented 6 months ago

I would have created one event with different payloads for the status, but this works just as well :)

romanoe commented 6 months ago

I would have created one event with different payloads for the status, but this works just as well :)

Yes, you're right. I refactored the code by adding a status variable as a class member to maintain a global status of the data fetching process in case we need it for further development. Additionally, I included a method that dispatches a general event containing the current status.