UNPKG

@uni/loading

Version:
26 lines (24 loc) 857 B
import { normalizeHide } from "../common"; import { CONTAINER_NAME } from "../_utils/constant"; export var hideLoading = normalizeHide(function (_ref) { var _ref$success = _ref.success, success = _ref$success === void 0 ? function () {} : _ref$success, _ref$fail = _ref.fail, fail = _ref$fail === void 0 ? function () {} : _ref$fail, _ref$complete = _ref.complete, complete = _ref$complete === void 0 ? function () {} : _ref$complete; try { setTimeout(function () { if (window.__uni_loadingWin && window.__uni_loadingWin.parentNode) { window.__uni_loadingWin.parentNode.removeChild(window.__uni_loadingWin); } window.__uni_loadingWin = null; success(); complete(); }, 0); } catch (error) { fail(); complete(); } }, CONTAINER_NAME.WEB); export default hideLoading;