MCPcopy Create free account
hub / github.com/tdewolff/minify / notify

Function notify

_benchmarks/sample_antd.js:15263–15303  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

15261 holder = _useRCNotification2[1];
15262
15263 function notify(args) {
15264 var customizePrefixCls = args.prefixCls;
15265 var mergedPrefixCls = getPrefixCls('message', customizePrefixCls);
15266 var rootPrefixCls = getPrefixCls();
15267 var target = args.key || Object(___WEBPACK_IMPORTED_MODULE_5__[/* getKeyThenIncreaseKey */ "c"])();
15268 var closePromise = new Promise(function (resolve) {
15269 var callback = function callback() {
15270 if (typeof args.onClose === 'function') {
15271 args.onClose();
15272 }
15273
15274 return resolve(true);
15275 };
15276
15277 getRcNotificationInstance(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, args), {
15278 prefixCls: mergedPrefixCls,
15279 rootPrefixCls: rootPrefixCls
15280 }), function (_ref) {
15281 var prefixCls = _ref.prefixCls,
15282 instance = _ref.instance;
15283 innerInstance = instance;
15284 hookNotify(getRCNoticeProps(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, args), {
15285 key: target,
15286 onClose: callback
15287 }), prefixCls));
15288 });
15289 });
15290
15291 var result = function result() {
15292 if (innerInstance) {
15293 innerInstance.removeNotice(target);
15294 }
15295 };
15296
15297 result.then = function (filled, rejected) {
15298 return closePromise.then(filled, rejected);
15299 };
15300
15301 result.promise = closePromise;
15302 return result;
15303 } // Fill functions
15304
15305
15306 var hookApiRef = react__WEBPACK_IMPORTED_MODULE_2__["useRef"]({});

Callers

nothing calls this directly

Calls 2

getRCNoticePropsFunction · 0.85
getNotificationInstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…