Show Loader
Shows the native full-screen loader in the app.
Description
The showLoader() action displays the native full-screen loader while an async operation is in progress.
Function Signature
await Superfans.actions.showLoader();| Parameter | Type | Required | Description |
|---|---|---|---|
| Nil | Nil | Nil | This action does not require any parameter. |
Structure of Response
| Status | Response |
|---|---|
| Success | { "status": "success", "message": "Loader shown successfully" } |
| Unexpected Error | { "status": "error", "errorId": 500, "errorHandle": "unknown-error", "message": "Something unexpected happened" } |
Example Usage
await Superfans.actions.showLoader();Best Practices
- Show the loader only for longer async work, such as Storefront queries or checkout setup.
- Always pair
showLoader()withhideLoader()in atry/finallyblock so the loader does not stay on screen after an error.
Caveats
- This shows the native app loader, not a custom-block spinner.
- Leaving the loader visible will block the rest of the screen until
hideLoader()is called.
Updated about 7 hours ago
Did this page help you?