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();
ParameterTypeRequiredDescription
NilNilNilThis action does not require any parameter.

Structure of Response

StatusResponse
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

  1. Always call hideLoader() in a finally block so the loader is dismissed even when the request fails.
  2. Do not hide a loader that a different flow still needs; keep show/hide pairs in the same function.

Caveats

  1. This hides the native app loader, not a custom-block spinner.
  2. Calling hideLoader() when no loader is visible is a no-op.

Did this page help you?