Private
Public Access
1
0
Files
power-apps-codeapps-blog-part2/node_modules/@fluentui/react-toast/lib-commonjs/state/vanilla/dispatchToast.js

27 lines
746 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "dispatchToast", {
enumerable: true,
get: function() {
return dispatchToast;
}
});
const _constants = require("../constants");
let counter = 0;
function dispatchToast(content, options = {}, targetDocument) {
var _options_toastId;
const detail = {
...options,
content,
toastId: (_options_toastId = options.toastId) !== null && _options_toastId !== void 0 ? _options_toastId : (counter++).toString()
};
const event = new CustomEvent(_constants.EVENTS.show, {
bubbles: false,
cancelable: false,
detail
});
targetDocument.dispatchEvent(event);
}