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

Structure of Response

StatusResponse
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

  1. Show the loader only for longer async work, such as Storefront queries or checkout setup.
  2. Always pair showLoader() with hideLoader() in a try/finally block so the loader does not stay on screen after an error.

Caveats

  1. This shows the native app loader, not a custom-block spinner.
  2. Leaving the loader visible will block the rest of the screen until hideLoader() is called.

Did this page help you?