hideToast(params: Object)

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

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

Description

Hide the toast message

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 { showToast, hideToast } from '@ray-js/ray'

// Hide the toast: call showToast first, then call hideToast to hide it
showToast({
  title: "Success",
  icon: "success",
  mask: false,
  success: () => {
    hideToast({
      success: () => console.log("Toast hidden"),
      fail: error => console.error(error),
    });
  },
  fail: error => console.error(error),
});