Hide Loader
Hides the native full-screen loader in the app.
Description
The hideLoader() action hides the native full-screen loader after an async operation completes.
Function Signature
await Superfans.actions.hideLoader();| Parameter | Type | Required | Description |
|---|---|---|---|
| Nil | Nil | Nil | This action does not require any parameter. |
Structure of Response
| Status | Response |
|---|---|
| Success | { "status": "success", "message": "Loader hidden successfully" } |
| Unexpected Error | { "status": "error", "errorId": 500, "errorHandle": "unknown-error", "message": "Something unexpected happened" } |
Example Usage
try {
await Superfans.actions.showLoader();
await Superfans.helpers.getStorefrontData({ query });
} finally {
await Superfans.actions.hideLoader();
}Best Practices
- Always call
hideLoader()in afinallyblock so the loader is dismissed even when the request fails. - Do not hide a loader that a different flow still needs; keep show/hide pairs in the same function.
Caveats
- This hides the native app loader, not a custom-block spinner.
- Calling
hideLoader()when no loader is visible is a no-op.
Updated about 7 hours ago
Did this page help you?