hideLoading(params: Object)

Requires:
BaseKit≥2.0.1@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
import { hideLoading } from '@ray-js/ray';

// Promise usage
try {
  const res = await hideLoading();
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Hide the loading indicator

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { showLoading, hideLoading } from '@ray-js/ray'

// Hide the loading prompt: call showLoading first, then call hideLoading to hide it
showLoading({
  title: "Loading...",
  mask: true,
  success: () => {
    hideLoading({
      success: () => console.log("Loading hidden"),
      fail: error => console.error(error),
    });
  },
  fail: error => console.error(error),
});