MCPcopy
hub / github.com/tdewolff/minify / notice

Function notice

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

Source from the content-addressed store, hash-verified

15486}
15487
15488function notice(args) {
15489 var target = args.key || key++;
15490 var closePromise = new Promise(function (resolve) {
15491 var callback = function callback() {
15492 if (typeof args.onClose === 'function') {
15493 args.onClose();
15494 }
15495
15496 return resolve(true);
15497 };
15498
15499 getRCNotificationInstance(args, function (_ref) {
15500 var prefixCls = _ref.prefixCls,
15501 instance = _ref.instance;
15502 instance.notice(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), {
15503 key: target,
15504 onClose: callback
15505 }), prefixCls));
15506 });
15507 });
15508
15509 var result = function result() {
15510 if (messageInstance) {
15511 messageInstance.removeNotice(target);
15512 }
15513 };
15514
15515 result.then = function (filled, rejected) {
15516 return closePromise.then(filled, rejected);
15517 };
15518
15519 result.promise = closePromise;
15520 return result;
15521}
15522
15523function isArgsProps(content) {
15524 return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;

Callers

nothing calls this directly

Calls 3

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…