⚙️ Global Events
Overview
The ⚙️ Global Events reusable element is designed to centralize and manage app-wide events, ensuring consistency and efficiency across different pages. This element acts as a global event handler, triggering workflows that need to run in multiple places without duplicating logic.
Common Use Cases
1. Logging and Debugging
Captures API responses, errors, or user actions and logs them for debugging or analytics purposes. For example, if an API call fails, a logging workflow can store the response for review.
2. Payment Processing (Stripe Integration)
Handles one-time checkouts, subscription creation, and subscription updates in a centralized manner. Ensures payment-related workflows are executed consistently across the app.
3. Alerts (Toast Notifications)
Displays user-friendly toast messages for important updates (e.g., successful transactions, errors, or warnings). For instance, after a user completes a purchase, a success toast appears confirming the transaction.
Implementation
Add the ⚙️ Global Events reusable element to your app layout or pages that require centralized event handling.
Configure workflows inside the element to handle API responses, Stripe transactions, notifications, or other global functions.
Trigger the workflows using custom events or API calls to keep the app modular and maintainable.
Last updated